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.



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

def config
  @config
end

Instance Method Details

#key_avro_field_namesObject



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

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

#key_avro_field_referencesObject



40
41
42
43
44
# File 'lib/avromatic/model/configurable.rb', line 40

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_nameObject



50
51
52
# File 'lib/avromatic/model/configurable.rb', line 50

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

#nested_modelsObject



54
55
56
# File 'lib/avromatic/model/configurable.rb', line 54

def nested_models
  config.nested_models || Avromatic.nested_models
end

#value_avro_field_namesObject



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

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

#value_avro_field_referencesObject



34
35
36
37
38
# File 'lib/avromatic/model/configurable.rb', line 34

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_nameObject



46
47
48
# File 'lib/avromatic/model/configurable.rb', line 46

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