Class: Icss::Meta::EnumSchema
- Inherits:
-
StructuredSchema
- Object
- NamedSchema
- StructuredSchema
- Icss::Meta::EnumSchema
- Defined in:
- lib/icss/type/structured_schema.rb,
lib/icss/type.rb
Overview
An EnumSchema escribes an 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"]
}
Instance Attribute Summary
Attributes inherited from NamedSchema
Instance Method Summary collapse
Methods inherited from NamedSchema
#attrs_to_inscribe, #is_core?, #model_klass, receive, #to_hash
Methods included from ReceiverModel::ActsAsHash
#[], #[]=, #attributes, #delete, included, #keys, #to_hash
Methods included from RecordModel
#attr_set?, included, #receive!, #to_zaml
Instance Method Details
#type ⇒ Object
228 |
# File 'lib/icss/type/structured_schema.rb', line 228 def type() :enum ; end |