Class: Avro::Builder::Types::MapType

Inherits:
Type
  • Object
show all
Includes:
ComplexType, ConfigurableType, TypeReferencer
Defined in:
lib/avro/builder/types/map_type.rb

Constant Summary

Constants included from Avro::Builder::TypeFactory

Avro::Builder::TypeFactory::BUILTIN_TYPES, Avro::Builder::TypeFactory::COMPLEX_TYPES

Instance Attribute Summary

Attributes inherited from Type

#type_name

Instance Method Summary collapse

Methods included from TypeReferencer

#create_builtin_or_lookup_named_type

Methods included from ConfigurableType

#configure_options

Methods included from ComplexType

included, #initialize, #namespace

Methods inherited from Type

#cache!, #configure_options, #dsl_method?, #dsl_respond_to?, #initialize, #namespace, union_with_null

Methods included from DslAttributes

#dsl_attribute?, included

Methods included from DslOptions

#dsl_option?, included

Instance Method Details

#serialize(referenced_state) ⇒ Object



17
18
19
20
21
22
# File 'lib/avro/builder/types/map_type.rb', line 17

def serialize(referenced_state)
  {
    type: type_name,
    values: values.serialize(referenced_state)
  }
end

#validate!Object



24
25
26
# File 'lib/avro/builder/types/map_type.rb', line 24

def validate!
  validate_required_attribute!(:values)
end