From: Travis Smith Date: 2005-03-22T14:28:55+09:00 Subject: Loading singletons from a file. Say I have a class Here, and I loaded that class from some file outside my driver via require. So now the class Here is in my namespace and I can create a new one with Here.new. What I would like to do is create a singleton of the same class with information stored in another ruby file. That file would contain something like this.... class Here def initialize @var1 = "something else" end # adding a method that isn't part of the normal Here class def new_method # do something end end Now, I could just create the singleton and store it somewhere for when I needed it, but I plan on having a number of these. Each of them in their own file. I thought perhaps I would need to add a line of code to the end of the to store that singleton where I needed it. This really didn't end up working for me. It would just use the global class when I would load the file via load _filename_, false. What I would really like is just some way to turn a file into an anonymous class and be able to initialize it just as is. I'm not sure if that's easily possible though. Thanks for any ideas here. I've only been on Ruby for four days now, but it's been pretty easy to get this far. -- ~Travis