From: Kevin Mahler Date: 2011-04-17T02:53:31+09:00 Subject: Re: What do you do when you need to attach data to an object instance? 7stud >> Because module_eval and class_eval are aliases, class_eval can be >> called on a module, a situation which is at worst wrong > >It certainly isn't "wrong"--ruby allows it. Wrong is not synonymous with illegal. One could easily argue that the alias is a mistake. class_eval, as the name suggests, should have been a more restricted version of module_eval. Allowing class_eval to have a module receiver is wrong because a module is not a class. I presented this as the "at worst" case--one end of the spectrum. >> and at best >> confusing. module_eval can never be wrong or confusing. Not a hard >> choice. > >I thought using module_eval was confusing in your code, and that was why >I suggested class_eval(). A class is a module. -- Posted via http://www.ruby-forum.com/.