Sha256: a039a7bd5a4def28a525cab6c55caac5f92cf55414b111e83af70d4d42a94fed

Contents?: true

Size: 712 Bytes

Versions: 4

Compression:

Stored size: 712 Bytes

Contents

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

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

        def validate!
          validate_required_attribute!(:items)
        end

        def serialize(referenced_state)
          {
            type: avro_type_name,
            items: items.serialize(referenced_state)
          }
        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/array_type.rb
avro-builder-0.9.0 lib/avro/builder/types/array_type.rb
avro-builder-0.8.0 lib/avro/builder/types/array_type.rb
avro-builder-0.7.0 lib/avro/builder/types/array_type.rb