Sha256: e2d930b41f63e864055f2204d536da998aaf2d7e1f6583b87df895d09cb6fe63

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

module Avro
  module Builder
    module Types
      class MapType < Type
        include Avro::Builder::Types::ComplexType
        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)
          super(referenced_state,
                overrides: { values: values.serialize(referenced_state) })
        end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
avro-builder-0.11.0 lib/avro/builder/types/map_type.rb