On Sun, Feb 22, 2009 at 12:19 AM, Adrian Klingel
<adrian.klingel / illumaware.com> wrote:
> Ahhh, I'm missing the "self", thanks Sean.  But here's the other issue.
> At runtime I don't know what module is going to be used.  It could be
> one of several. I don't know that it's Foo::Bar.  It might be Foo:Bat or
> Bat::Fat.
>

You can use Module#const_get to look up a module by name.

It helps if you can arrange for all the possible modules to be
contained in a single namespace - it can be Foo::Bar or Foo:Baz, but
not X::Y.  That way you can look up the module with
Foo.const_get(name).

If it can be any arbitrary module (bad idea), you'll have to call
const_get on Kernel.

Cheers,
lasitha.