Change a string into class name

Posted . Visible to the public.

In Ruby, class names are constants, so you can do

str = "Thing" #=> "Thing"
Kernel.const_get(str) #=> Thing
Sandheep
Posted by Sandheep to Sandheep's deck (2013-04-25 14:19)