0

Possible Duplicate:
How to convert a string to a constant in Ruby?

I am wondering whether there is a way for me to convert a string to a class in ruby. What i mean by this is that, given a String like

'Fixnum' 

i want a way to get the class

Fixnum 

back

can someone give me an idea on how to do this?

0

1 Answer 1

0

"FixNum".classify.contantize should do it

Sign up to request clarification or add additional context in comments.

1 Comment

I think that's only in Rails. Anyway this question is (I hope) about to be closed as a duplicate...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.