Sha256: 19e36d69001e8e7a3a2bf983aa5e2171fde3fb93f9bf3afba74b7cb3f5a1f1cf

Contents?: true

Size: 682 Bytes

Versions: 7

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

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

7 entries across 7 versions & 1 rubygems

Version Path
avro-builder-2.1.0 lib/avro/builder/types/map_type.rb
avro-builder-2.0.0 lib/avro/builder/types/map_type.rb
avro-builder-1.1.0 lib/avro/builder/types/map_type.rb
avro-builder-1.0.1 lib/avro/builder/types/map_type.rb
avro-builder-1.0.0 lib/avro/builder/types/map_type.rb
avro-builder-0.17.0 lib/avro/builder/types/map_type.rb
avro-builder-0.16.2 lib/avro/builder/types/map_type.rb