Friday, 15 February 2013

ruby - Eval in a module, but the class is not part of the module -



ruby - Eval in a module, but the class is not part of the module -

i have module database. in module, eval("myclass") returns database::myclass inexistent. want evaluated outside of databasemodule. knows how done?

you should seek specifying global scope explicitly then:

eval('::myclass')

ruby module eval

No comments:

Post a Comment