Class: Avro::Schema::MapSchema

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

Constant Summary

Constants inherited from Avro::Schema

CRC_EMPTY, DECIMAL_LOGICAL_TYPE, DEFAULT_VALIDATE_OPTIONS, INT_MAX_VALUE, INT_MIN_VALUE, LONG_MAX_VALUE, LONG_MIN_VALUE, NAMED_TYPES, NAMED_TYPES_SYM, NAME_REGEX, PRIMITIVE_TYPES, PRIMITIVE_TYPES_SYM, SINGLE_OBJECT_MAGIC_NUMBER, VALID_TYPES, VALID_TYPES_SYM

Instance Attribute Summary collapse

Attributes inherited from Avro::Schema

#logical_type, #type_sym

Instance Method Summary collapse

Methods inherited from Avro::Schema

#==, #be_read?, #crc_64_avro_fingerprint, #hash, #initFPTable, #md5_fingerprint, #mutual_read?, parse, #read?, real_parse, #sha256_fingerprint, #single_object_encoding_header, #single_object_schema_fingerprint, #subparse, #to_s, #type, #type_adapter, validate

Constructor Details

#initialize(values, names = nil, default_namespace = nil) ⇒ MapSchema

Returns a new instance of MapSchema.



387
388
389
390
# File 'lib/avro/schema.rb', line 387

def initialize(values, names=nil, default_namespace=nil)
  super(:map)
  @values = subparse(values, names, default_namespace)
end

Instance Attribute Details

#valuesObject (readonly)

Returns the value of attribute values.



385
386
387
# File 'lib/avro/schema.rb', line 385

def values
  @values
end

Instance Method Details

#to_avro(names = Set.new) ⇒ Object



392
393
394
# File 'lib/avro/schema.rb', line 392

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