Class: Icss::EnumType
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
Instance Attribute Summary
Attributes inherited from NamedType
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_hash ⇒ Object
381 382 383 |
# File 'lib/icss/type.rb', line 381 def to_hash super.merge( :symbols => symbols ) end |