Class | RGen::MetamodelBuilder::DataTypes::Enum |
In: |
lib/rgen/metamodel_builder/data_types.rb
|
Parent: | Object |
An enum object is used to describe possible attribute values within a MetamodelBuilder attribute definition. An attribute defined this way can only take the values specified when creating the Enum object. Literal values can only be symbols or true or false. Optionally a name may be specified for the enum object.
Examples:
Enum.new(:name => "AnimalEnum", :literals => [:cat, :dog]) Enum.new(:literals => [:cat, :dog]) Enum.new([:cat, :dog])