Class: Avro::Schema::ArraySchema

Inherits:
Avro::Schema show all
Defined in:
lib/avro/schema.rb

Constant Summary

Constants inherited from Avro::Schema

INT_MAX_VALUE, INT_MIN_VALUE, LONG_MAX_VALUE, LONG_MIN_VALUE, NAMED_TYPES, NAMED_TYPES_SYM, PRIMITIVE_TYPES, PRIMITIVE_TYPES_SYM, VALID_TYPES, VALID_TYPES_SYM

Instance Attribute Summary collapse

Attributes inherited from Avro::Schema

#type_sym

Instance Method Summary collapse

Methods inherited from Avro::Schema

#==, #hash, parse, real_parse, #subparse, #to_s, #type, validate

Constructor Details

#initialize(items, names = nil, default_namespace = nil) ⇒ ArraySchema

Returns a new instance of ArraySchema.



248
249
250
251
# File 'lib/avro/schema.rb', line 248

def initialize(items, names=nil, default_namespace=nil)
  super(:array)
  @items = subparse(items, names, default_namespace)
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



246
247
248
# File 'lib/avro/schema.rb', line 246

def items
  @items
end

Instance Method Details

#to_avro(names = Set.new) ⇒ Object



253
254
255
# File 'lib/avro/schema.rb', line 253

def to_avro(names=Set.new)
  super.merge('items' => items.to_avro(names))
end