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])

Methods

Attributes

literals  [R] 
name  [R] 

Public Class methods

Creates a new named enum type object consisting of the elements passed as arguments.

Public Instance methods

This method can be used to check if an object can be used as value for variables having this enum object as type.

[Validate]