Module: Avromatic::Model::Configurable::ClassMethods
- Defined in:
- lib/avromatic/model/configurable.rb
Instance Method Summary collapse
- #key_avro_field_names ⇒ Object
- #key_avro_field_references ⇒ Object
- #key_avro_fields_by_name ⇒ Object
- #nested_models ⇒ Object
- #value_avro_field_names ⇒ Object
- #value_avro_field_references ⇒ Object
- #value_avro_fields_by_name ⇒ Object
Instance Method Details
#key_avro_field_names ⇒ Object
34 35 36 |
# File 'lib/avromatic/model/configurable.rb', line 34 def key_avro_field_names @key_avro_field_names ||= key_avro_schema.fields.map(&:name).map(&:to_sym).freeze end |
#key_avro_field_references ⇒ Object
44 45 46 47 48 |
# File 'lib/avromatic/model/configurable.rb', line 44 def key_avro_field_references @key_avro_field_references ||= key_avro_schema.fields.map do |field| Avromatic::Model::Configurable::FieldReference.new(field.name) end.freeze end |
#key_avro_fields_by_name ⇒ Object
54 55 56 |
# File 'lib/avromatic/model/configurable.rb', line 54 def key_avro_fields_by_name @key_avro_fields_by_name ||= mapped_by_name(key_avro_schema) end |
#nested_models ⇒ Object
58 59 60 |
# File 'lib/avromatic/model/configurable.rb', line 58 def nested_models config.nested_models || Avromatic.nested_models end |
#value_avro_field_names ⇒ Object
30 31 32 |
# File 'lib/avromatic/model/configurable.rb', line 30 def value_avro_field_names @value_avro_field_names ||= value_avro_schema.fields.map(&:name).map(&:to_sym).freeze end |
#value_avro_field_references ⇒ Object
38 39 40 41 42 |
# File 'lib/avromatic/model/configurable.rb', line 38 def value_avro_field_references @value_avro_field_references ||= value_avro_schema.fields.map do |field| Avromatic::Model::Configurable::FieldReference.new(field.name) end.freeze end |
#value_avro_fields_by_name ⇒ Object
50 51 52 |
# File 'lib/avromatic/model/configurable.rb', line 50 def value_avro_fields_by_name @value_avro_fields_by_name ||= mapped_by_name(value_avro_schema) end |