On 17 Mar 2006, at 16:58, Robert Klemme wrote: > benjohn / fysh.org wrote: >> I'd like to fill a module with valueless constants (because I >> don't care >> about the actual values, just that they are uneque, and named) - >> is that >> a good thing to do, and can I do that? :) >> I tried: >> module AnEnum >> :ValueOne >> :ValueTwo >> ... >> end >> But mentioning a constant's sysmbol doesn't define it. > > That's true. :-) If you just need the names you can just use > symbols (you don't even have to define them). You could do > > module AnEnum > VALUES = [ > :foo, > :bar, > :dummy, > ].freeze > end > > If you look for more sophisticated solutions: There was a posting > about this around 9. and 10. March this year with subject "Enums > (was: My Ruby talk @ work..)". Thank you, I will take a look for that thread. *snips*