From: Robert Dober Date: 2008-03-23T02:40:58+09:00 Subject: Re: including instance methods and setting an instance varia > > I am very confused by this thread > > Please don't. I would feel sorry to have caused confusion. :-) No not your post, I meant what OP really meant, but see below... > > > > but somehow have the feeling that OP > > wants this > > Actually we (I) do not exactly now what the OP exactly wants to do. That's what I meant above ;) > So > far I know only that he wants to access instance variables from a > module. I am guessing that he thinks it's somehow different than from > class instance methods. But it isn't (apart from the initialization > story, see previous posting). That is the key sentence he should read I agree, and Rick's technique is often useful in doing so especially in cases where the Mixin does not mix #initialize in (does not define a method initialize). > > A small addition: modules are a nice case where accessing instance > variables via accessor methods instead of directly pays off because then > you can centralize initialization: Yup; I all invite you to read Ricks Blog he wrote a great summary of that "pattern" on his Blog. Did you have problems with spam Rick, as comments are disabled? Wanted to tell you how much I enjoyed the read, I honestly think it is a valuable addition to what Kent says in the book. > Happy Easter Idem > > robert Idem ;) > > -- http://ruby-smalltalk.blogspot.com/ --- Whereof one cannot speak, thereof one must be silent. Ludwig Wittgenstein