module AvroTurf::AvroGemPatch::Field
Public Class Methods
new(type, name, default=:no_default, order=nil, names=nil, namespace=nil)
click to toggle source
Calls superclass method
# File lib/avro_turf/schema_to_avro_patch.rb, line 26 def initialize(type, name, default=:no_default, order=nil, names=nil, namespace=nil) super(type, name, default, order, names, namespace) end
Public Instance Methods
to_avro(names=Set.new)
click to toggle source
# File lib/avro_turf/schema_to_avro_patch.rb, line 30 def to_avro(names=Set.new) {'name' => name, 'type' => type.to_avro(names)}.tap do |avro| avro['default'] = default unless default == :no_default avro['order'] = order if order end end