Module: AvroTurf::AvroGemPatch::RecordSchema::ClassMethods

Defined in:
lib/avro_turf/schema_to_avro_patch.rb

Instance Method Summary collapse

Instance Method Details

#make_field_objects(field_data, names, namespace = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/avro_turf/schema_to_avro_patch.rb', line 5

def make_field_objects(field_data, names, namespace=nil)
  new_field_data = []
  field_data.each do |field|
    if field.respond_to?(:[]) && !field.key?('default')
      field = field.clone
      field['default'] = :no_default
    end
    new_field_data << field
  end
  super(new_field_data, names, namespace)
end