From: Robert Klemme Date: 2006-05-06T14:55:10+09:00 Subject: Re: klass.include vs instance.extend question 2006/5/6, polypus : > > > > > Did I miss something? > > ok forget all of my above code. i've solved that problem in another > thread, see 'mixin puzzle'. > > but i would still like to know when one would prefer extending the > individual objects instead of 'including' into their class (and vice > versa), and what the pros and cons of each method are. Well, the answe is pretty obvious: if you need all instances of a class to have these methods you'll certainly want to include the module in the class. If you just want to modify individual objects then you extend them on a one by one basis. And I guess extending individual objects is less efficient (at least memory wise) than doing it on the class level. robert > > thanks, > _c > > > -- > Posted via http://www.ruby-forum.com/. > > -- Have a look: http://www.flickr.com/photos/fussel-foto/