Sha256: 42b987207ad07fc8601328c9ffd90e43b48b4d1e2b3c370c53106f8e84ecdf18

Contents?: true

Size: 651 Bytes

Versions: 8

Compression:

Stored size: 651 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_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

8 entries across 8 versions & 1 rubygems

Version Path
avro-builder-0.16.1 lib/avro/builder/types/map_type.rb
avro-builder-0.16.0 lib/avro/builder/types/map_type.rb
avro-builder-0.15.0 lib/avro/builder/types/map_type.rb
avro-builder-0.15.0.rc0 lib/avro/builder/types/map_type.rb
avro-builder-0.14.1 lib/avro/builder/types/map_type.rb
avro-builder-0.14.0 lib/avro/builder/types/map_type.rb
avro-builder-0.13.0 lib/avro/builder/types/map_type.rb
avro-builder-0.12.0 lib/avro/builder/types/map_type.rb