Module namespace interpolation in rails

type = 'baz'
Foo::Bar.const_get(type.capitalize).new
# => new instance of Foo::Bar::Baz
comments powered by Disqus