This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
LICENSE.txt | Wed Jun 24 12:36:17 -0700 2009 | |
| |
README.textile | Wed Jun 24 12:13:12 -0700 2009 | |
| |
Rakefile | Wed Jun 24 11:23:35 -0700 2009 | |
| |
lib/ | Wed Jun 24 12:13:12 -0700 2009 | |
| |
spec/ | Wed Jun 24 11:57:20 -0700 2009 |
README.textile
Enumeration
Between string and symbol array literals, hash literals, and constants in
modules or classes, Ruby users have plenty of options for enumeration
constructs. If you need more, try Enumeration.
irb> Melons = Enumeration.of :watermelon, :honeydew, :cantelope
irb> Melons::HONEYDEW
=> :honeydew
irb> Melons.enum
=> [:watermelon, :honeydew, :cantelope]
irb> Melons.to_s
=> ["watermelon", "honeydew", "cantelope"]
irb> Melons::Order
=> {:cantelope=>2, :watermelon=>0, :honeydew=>1}
You can also use an array of strings to construct an Enumeration:
irb> Colors = Enumeration.of %w{fuschia red bondi cerulean carnelian}
irb> Colors::BONDI
=> :bondi
Author:
- Karlin Fox
- Atomic Object
- http://atomicobject.com







