Module: Avromatic::Model::Configurable::ClassMethods

Defined in:
lib/avromatic/model/configurable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config.



12
13
14
# File 'lib/avromatic/model/configurable.rb', line 12

def config
  @config
end

Instance Method Details

#key_avro_field_namesObject



19
20
21
# File 'lib/avromatic/model/configurable.rb', line 19

def key_avro_field_names
  @key_avro_field_names ||= key_avro_schema.fields.map(&:name).map(&:to_sym).freeze
end

#key_avro_fields_by_nameObject



27
28
29
# File 'lib/avromatic/model/configurable.rb', line 27

def key_avro_fields_by_name
  @key_avro_fields_by_name ||= mapped_by_name(key_avro_schema)
end

#nested_modelsObject



31
32
33
# File 'lib/avromatic/model/configurable.rb', line 31

def nested_models
  config.nested_models || Avromatic.nested_models
end

#value_avro_field_namesObject



15
16
17
# File 'lib/avromatic/model/configurable.rb', line 15

def value_avro_field_names
  @value_avro_field_names ||= value_avro_schema.fields.map(&:name).map(&:to_sym).freeze
end

#value_avro_fields_by_nameObject



23
24
25
# File 'lib/avromatic/model/configurable.rb', line 23

def value_avro_fields_by_name
  @value_avro_fields_by_name ||= mapped_by_name(value_avro_schema)
end