class Tros::Schema::PrimitiveSchema
Valid primitive types are in PRIMITIVE_TYPES.
Public Class Methods
new(type)
click to toggle source
Calls superclass method
Tros::Schema::new
# File lib/tros/schema.rb 328 def initialize(type) 329 if PRIMITIVE_TYPES_SYM.include?(type) 330 super(type) 331 elsif PRIMITIVE_TYPES.include?(type) 332 super(type.to_sym) 333 else 334 raise AvroError.new("#{type} is not a valid primitive type.") 335 end 336 end
Public Instance Methods
to_avro(names=nil)
click to toggle source
Calls superclass method
Tros::Schema#to_avro
# File lib/tros/schema.rb 338 def to_avro(names=nil) 339 hsh = super 340 hsh.size == 1 ? type : hsh 341 end