Class: Icss::EnumType

Inherits:
NamedType show all
Defined in:
lib/icss/type.rb

Overview

Describes an Avro Enum type.

Enums use the type name “enum” and support the following attributes:

name: a string providing the name of the enum (required). namespace: a string that qualifies the name; doc: a string providing documentation to the user of this schema (optional). symbols: an array, listing symbols, as strings or ruby symbols (required). All

symbols in an enum must be unique; duplicates are prohibited.

For example, playing card suits might be defined with:

{ “type”: “enum”,

"name": "Suit",
"symbols" : ["SPADES", "HEARTS", "DIAMONDS", "CLUBS"]

}

Constant Summary

Constants inherited from Type

Type::PRIMITIVE_TYPES

Instance Attribute Summary

Attributes inherited from NamedType

#parent

Instance Method Summary collapse

Methods inherited from NamedType

#fullname, #name=, #namespace, #receive_namespace

Methods included from Validations

#validate_name, #validate_namespace

Methods inherited from Type

find, pig_name, primitive?, #primitive?, #title, #to_json

Instance Method Details

#to_hashObject



377
378
379
# File 'lib/icss/type.rb', line 377

def to_hash
  super.merge( :symbols => symbols )
end