Class: Opencdd::Entity::FieldRegistry::Entry
- Inherits:
-
Struct
- Object
- Struct
- Opencdd::Entity::FieldRegistry::Entry
- Defined in:
- lib/opencdd/entity/field_registry.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#entity_class ⇒ Object
Returns the value of attribute entity_class.
-
#json_key ⇒ Object
Returns the value of attribute json_key.
-
#multilingual ⇒ Object
Returns the value of attribute multilingual.
-
#name ⇒ Object
Returns the value of attribute name.
-
#property_id ⇒ Object
Returns the value of attribute property_id.
-
#reader ⇒ Object
Returns the value of attribute reader.
-
#synthetic ⇒ Object
Returns the value of attribute synthetic.
-
#value_kind ⇒ Object
Returns the value of attribute value_kind.
Instance Method Summary collapse
-
#block? ⇒ Boolean
True when this field's value is computed by a block rather than read directly from
properties. - #multilingual? ⇒ Boolean
- #synthetic? ⇒ Boolean
-
#wire_name ⇒ Object
The key to use when serializing this field to JSON.
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
9 10 11 |
# File 'lib/opencdd/entity/field_registry.rb', line 9 def block @block end |
#entity_class ⇒ Object
Returns the value of attribute entity_class
9 10 11 |
# File 'lib/opencdd/entity/field_registry.rb', line 9 def entity_class @entity_class end |
#json_key ⇒ Object
Returns the value of attribute json_key
9 10 11 |
# File 'lib/opencdd/entity/field_registry.rb', line 9 def json_key @json_key end |
#multilingual ⇒ Object
Returns the value of attribute multilingual
9 10 11 |
# File 'lib/opencdd/entity/field_registry.rb', line 9 def multilingual @multilingual end |
#name ⇒ Object
Returns the value of attribute name
9 10 11 |
# File 'lib/opencdd/entity/field_registry.rb', line 9 def name @name end |
#property_id ⇒ Object
Returns the value of attribute property_id
9 10 11 |
# File 'lib/opencdd/entity/field_registry.rb', line 9 def property_id @property_id end |
#reader ⇒ Object
Returns the value of attribute reader
9 10 11 |
# File 'lib/opencdd/entity/field_registry.rb', line 9 def reader @reader end |
#synthetic ⇒ Object
Returns the value of attribute synthetic
9 10 11 |
# File 'lib/opencdd/entity/field_registry.rb', line 9 def synthetic @synthetic end |
#value_kind ⇒ Object
Returns the value of attribute value_kind
9 10 11 |
# File 'lib/opencdd/entity/field_registry.rb', line 9 def value_kind @value_kind end |
Instance Method Details
#block? ⇒ Boolean
True when this field's value is computed by a block rather
than read directly from properties. FieldReader dispatches
block-defined fields via instance_exec, which preserves
access to private helpers — no send bypass required.
21 22 23 |
# File 'lib/opencdd/entity/field_registry.rb', line 21 def block? !block.nil? end |
#multilingual? ⇒ Boolean
15 |
# File 'lib/opencdd/entity/field_registry.rb', line 15 def multilingual? = !!multilingual |
#synthetic? ⇒ Boolean
14 |
# File 'lib/opencdd/entity/field_registry.rb', line 14 def synthetic? = !!synthetic |
#wire_name ⇒ Object
The key to use when serializing this field to JSON. Defaults
to the field's ruby name. Override via the as: DSL option
when the wire-format name should differ from the method
name (e.g. is_case_of_irdis → is_case_of).
29 30 31 |
# File 'lib/opencdd/entity/field_registry.rb', line 29 def wire_name (json_key || name).to_s end |