I'm looking to define dynamic classes, and in order to get them to
play nicely with Rails I need them to behaving like a constantly
defiend class.

foo = Class.new

Won't work AFAIK because

foo.class == Class

If the new class is defined to a constant however it will work.

Foo = Class.new

So far the only way I know of to do this is to use eval.

newclass = eval("Foo#{some_string} = Class.new")

and then I can define new class as I see fit. However I do not want to
use eval if I can help it. Can anyone make any suggestions?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to