I have something like this:
string = \"Post\"
I would like to convert the string to a class name literal. I use eval like this to convert t
Use Module.const_get
string = "Fixnum" clazz = Object.const_get(string) clazz.name # => "Fixnum"
If you are in a rails context, you can also use the `#constantize method on string
clazz = string.constantize # => Fixnum