Sha256: 5d3f346ac1ccd89e52726e1f4331b290e5464374cfb9e49ee2bce0bdd29551c7

Contents?: true

Size: 716 Bytes

Versions: 4

Compression:

Stored size: 716 Bytes

Contents

module Avro
  module Builder
    module Types
      class MapType < Type
        include Avro::Builder::Types::ComplexType
        include Avro::Builder::Types::ConfigurableType
        include Avro::Builder::Types::TypeReferencer

        dsl_attribute :values do |value_type = nil|
          if value_type
            @values = create_builtin_or_lookup_named_type(value_type)
          else
            @values
          end
        end

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

        def validate!
          validate_required_attribute!(:values)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
avro-builder-0.10.0 lib/avro/builder/types/map_type.rb
avro-builder-0.9.0 lib/avro/builder/types/map_type.rb
avro-builder-0.8.0 lib/avro/builder/types/map_type.rb
avro-builder-0.7.0 lib/avro/builder/types/map_type.rb