Enumerated Scalar

As a one time Pascal programmer - does Ruby have the concept of an
enumerated scalar? It seems to have enumerations but I can’t see a
standard method that recognizes inate ordering eg EObj.next, EObj < FObj
etc

On Wed, Nov 3, 2010 at 3:11 PM, Mike S. [email protected]
wrote:

As a one time Pascal programmer - does Ruby have the concept of an
enumerated scalar? It seems to have enumerations but I can’t see a
standard method that recognizes inate ordering eg EObj.next, EObj < FObj
etc

There is definitively nothing built in. You have to create this
yourself or use one of the libs out there that implement enums.

http://raa.ruby-lang.org/project/enum/
http://raa.ruby-lang.org/search.rhtml?search=enum

Also, often Symbols are used to represent fixed values.

Kind regards

robert