Sha256: 89b55287c7f672dbb5c6e48ed1c8fb7b8a633e30630a3db7c1b452c93ac7abec

Contents?: true

Size: 610 Bytes

Versions: 3

Compression:

Stored size: 610 Bytes

Contents

module Avro
  module Builder
    module Types
      class ArrayType < Type
        include Avro::Builder::Types::SpecificType
        include Avro::Builder::Types::ConfigurableType
        include Avro::Builder::Types::TypeReferencer

        dsl_attribute :items do |items_type = nil|
          if items_type
            @items = find_or_create_type(items_type)
          else
            @items
          end
        end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
avro-builder-0.3.1 lib/avro/builder/types/array_type.rb
avro-builder-0.3.0 lib/avro/builder/types/array_type.rb
avro-builder-0.2.0 lib/avro/builder/types/array_type.rb