Class: Opencdd::Entity::FieldRegistry::Entry

Inherits:
Struct
  • Object
show all
Defined in:
lib/opencdd/entity/field_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



9
10
11
# File 'lib/opencdd/entity/field_registry.rb', line 9

def block
  @block
end

#entity_classObject

Returns the value of attribute entity_class

Returns:

  • (Object)

    the current value of entity_class



9
10
11
# File 'lib/opencdd/entity/field_registry.rb', line 9

def entity_class
  @entity_class
end

#json_keyObject

Returns the value of attribute json_key

Returns:

  • (Object)

    the current value of json_key



9
10
11
# File 'lib/opencdd/entity/field_registry.rb', line 9

def json_key
  @json_key
end

#multilingualObject

Returns the value of attribute multilingual

Returns:

  • (Object)

    the current value of multilingual



9
10
11
# File 'lib/opencdd/entity/field_registry.rb', line 9

def multilingual
  @multilingual
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



9
10
11
# File 'lib/opencdd/entity/field_registry.rb', line 9

def name
  @name
end

#property_idObject

Returns the value of attribute property_id

Returns:

  • (Object)

    the current value of property_id



9
10
11
# File 'lib/opencdd/entity/field_registry.rb', line 9

def property_id
  @property_id
end

#readerObject

Returns the value of attribute reader

Returns:

  • (Object)

    the current value of reader



9
10
11
# File 'lib/opencdd/entity/field_registry.rb', line 9

def reader
  @reader
end

#syntheticObject

Returns the value of attribute synthetic

Returns:

  • (Object)

    the current value of synthetic



9
10
11
# File 'lib/opencdd/entity/field_registry.rb', line 9

def synthetic
  @synthetic
end

#value_kindObject

Returns the value of attribute value_kind

Returns:

  • (Object)

    the current value of 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.

Returns:

  • (Boolean)


21
22
23
# File 'lib/opencdd/entity/field_registry.rb', line 21

def block?
  !block.nil?
end

#multilingual?Boolean

Returns:

  • (Boolean)


15
# File 'lib/opencdd/entity/field_registry.rb', line 15

def multilingual? = !!multilingual

#synthetic?Boolean

Returns:

  • (Boolean)


14
# File 'lib/opencdd/entity/field_registry.rb', line 14

def synthetic?    = !!synthetic

#wire_nameObject

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