Class: Hecks::Forms::Field
- Inherits:
-
Struct
- Object
- Struct
- Hecks::Forms::Field
- Defined in:
- lib/hecks/forms/field_shape.rb
Overview
One resolved field, ready for a renderer to turn into markup. A LEAF
scalar carries kind/options/etc; a :group or :list carries
children instead and nothing else on itself.
path is the DOTTED field path this attribute is reached at —
"email.address", "amount.cents" — the same convention the language
already uses for a query's own cross-object where clauses
(where(:"customer.status" => ...)), not a fresh one invented here. A
command receives its arguments as nested hashes
(email: {address: "..."}), so Params.unflatten (params.rb) walks
this same dotted spelling back apart on submit — one convention, two
directions.
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#default ⇒ Object
Returns the value of attribute default.
-
#help ⇒ Object
Returns the value of attribute help.
-
#html_type ⇒ Object
Returns the value of attribute html_type.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#label ⇒ Object
Returns the value of attribute label.
-
#optional ⇒ Object
Returns the value of attribute optional.
-
#options ⇒ Object
Returns the value of attribute options.
-
#path ⇒ Object
Returns the value of attribute path.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#step ⇒ Object
Returns the value of attribute step.
-
#target_aggregate ⇒ Object
Returns the value of attribute target_aggregate.
Instance Method Summary collapse
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def children @children end |
#default ⇒ Object
Returns the value of attribute default
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def default @default end |
#help ⇒ Object
Returns the value of attribute help
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def help @help end |
#html_type ⇒ Object
Returns the value of attribute html_type
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def html_type @html_type end |
#kind ⇒ Object
Returns the value of attribute kind
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def kind @kind end |
#label ⇒ Object
Returns the value of attribute label
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def label @label end |
#optional ⇒ Object
Returns the value of attribute optional
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def optional @optional end |
#options ⇒ Object
Returns the value of attribute options
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def @options end |
#path ⇒ Object
Returns the value of attribute path
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def path @path end |
#pattern ⇒ Object
Returns the value of attribute pattern
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def pattern @pattern end |
#step ⇒ Object
Returns the value of attribute step
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def step @step end |
#target_aggregate ⇒ Object
Returns the value of attribute target_aggregate
18 19 20 |
# File 'lib/hecks/forms/field_shape.rb', line 18 def target_aggregate @target_aggregate end |
Instance Method Details
#leaf? ⇒ Boolean
22 |
# File 'lib/hecks/forms/field_shape.rb', line 22 def leaf? = kind != :group && kind != :list |
#optional? ⇒ Boolean
23 |
# File 'lib/hecks/forms/field_shape.rb', line 23 def optional? = optional |
#required? ⇒ Boolean
24 |
# File 'lib/hecks/forms/field_shape.rb', line 24 def required? = !optional |