exhal v7.1.1 ExHal.FormField

Functions for working with HAL form fields.

Link to this section Summary

Types

Field types

Possible value types

t()

A HAL form field

Functions

Create a new form field from parsed form json

Returns a form field with the specified value

Link to this section Types

Link to this type field_types()
field_types ::
  :boolean |
  :string |
  :number |
  :date |
  :time |
  :datetime |
  :sensitive |
  :hidden |
  :text |
  :email |
  :tel |
  :file

Field types.

Link to this type field_value()
field_value ::
  nil |
  true |
  false |
  list |
  float |
  integer |
  String.t

Possible value types.

Link to this type t()
t() :: %ExHal.FormField{name: String.t, path: String.t, type: field_types, value: field_value}

A HAL form field.

Link to this section Functions

Link to this function from_field_entry(a_map)
from_field_entry(%{}) :: ExHal.FormField.t

Create a new form field from parsed form json.

Raises ArgumentError if json is invalid.

Link to this function set_value(field, new_value)

Returns a form field with the specified value.

Raises ArgumentError if the new value is the wrong type.