Is there a better way to get to a class when you have the class name in
a string?
(This is rails-related, btw).. For instance, if I have a string clname
= 'Train', and I want to access a class method Train#label. I can do
this:
clname = 'Train'
label = eval "#{clname}.label"
Is there a better way?
--
Posted via http://www.ruby-forum.com/.