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

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

Instance Method Summary collapse

Instance Method Details

#key_avro_field_namesObject



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_referencesObject



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_nameObject



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_modelsObject



58
59
60
# File 'lib/avromatic/model/configurable.rb', line 58

def nested_models
  config.nested_models || Avromatic.nested_models
end

#value_avro_field_namesObject



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_referencesObject



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_nameObject



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