paulrayner/ddd_sample_app_ruby — pull request #56 by relaxdiego (2013-12-12 09:03:40+00:00)
Title: Initial commit for implementing Enum

Not a lot to go by in terms of the expected API for the Enum (or maybe I just didn't look hard enough in the existing specs?). Don't hesitate to let me know if I'm missing a few things.

BTW, I kind of like Jamis Buck's implementation too (http://weblog.jamisbuck.org/2005/8/7/enumerated-types-in-ruby) and I can see a way to make it work like so:

```ruby

class RoutingStatus < Enum
NotRouted
Misrouted
Routed
end

RoutingStatus[:NotRouted] #=> 0
RoutingStatus::Routed #=> 2
RoutingStatus[1] #=> RoutingStatus::MisRouted
```

Let me know what you think!