From: Luis Crespo Date: 2008-05-30T02:46:31+09:00 Subject: Re: Constants in modules Bryan JJ Buckley wrote: > Two things - firstly, Ruby is interpreted, so invert_hash needs to be > declared *before* you use it. Then, your methods need to be module > methods - just put a "self." before each one, and it should work. Yes, it works!! I already tried defining the method as a module method by prepending the module name to the method name, which AFAIK it is totally equivalent to prepending self. ...But I did not realize that the constant code is executed when reading the module, so I had to define the method before. Thank you! Luis. -- Posted via http://www.ruby-forum.com/.