From: Joel VanderWerf Date: 2005-05-22T05:05:37+09:00 Subject: Re: Anonymous module undefined method error johng wrote: ... > So, what I wanted to do, was have a class defined in a file and call > a known method on it. For instance: > > class Bar > def Bar.foo > return "foo" > end > end > > But I will not know the class name contained in the file (Bar). I > tried > the approach from the original post so that I could call a defined > method that would instantiate the class for me. I believe I can do > this now relatively easily. It does though put more requirements > on the file. This may be of use to you: http://raa.ruby-lang.org/project/script/ It's a very simple but useful way to load a ruby script and access the methods, classes, and other constants defined in it.