Getting the module of a class

Hi!

Can anybody think of a better way to get the module of a class in a
module?

eval(some_class_in_a_module.to_s.gsub(/::[^:]*$/, ‘’))

Thanks!

Ciao!
Florian

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs