------ extPart_000_001E_01C6169C.8B417570 Content-Type: text/plain; charset so-8859-1" Content-Transfer-Encoding: 7bit hmmm wrote: </snip> > I have tried different ways, but can't get the Correct Way to have a > module insert a variable into the Class that includes it. In this > case it should inject a @cookies hash, but in tests @cookies always > gets reset to Hash.new... Of course because you assign it in initialize. Two options: 1 Lazy init: You need to define cookies differently and access it always through the getter method (attachment ex1.rb) 2 Init during constructor: you need to define #initialize in the module and either leave initialize out of Bread or use super (attachment ex2.rb) Module#included is completely wrong here as you do not want to do anything to the class that uses the mod. > Excuse the inconsistencies in the code (towards @cookies) b/c I can't > seem to figure out the proper way. > > So how do you add instance vars to a class from a module and how to > reference that attribute? Or is this not the Right Ruby Way? > > I have a lot of confusion about modules... suppose its my java funk :/ Apparently. :-) > Please point me to any more docs on modules besides the ruby-lang > snippet. HTH Kind regards robert ------ extPart_000_001E_01C6169C.8B417570 Content-Type: application/octet-stream; nameアョ「 テュヤュナコ ュ テュトコ サ アョ「 テ ヘチリ゜テメユヘツモ ス アー 」 タ ス ゜ィ ャ ャ ゥ ス ォ 「゛「 ォ 。ス ヲヲ ョ 。ス ョョ ロン 。ス シシ 「゛「 シシ シシ 「゛「 シシ ロン ゜ィ ゥ ス ョ ス ロコ゜ン スス 「゜ココ 。「 スロン 「゜ココ マヒ。「 ス ョィ「「ゥ 」ァ ョ スス 」 シシ 」 オ ョ セ タタヘチリ゜テメユヘツモ ョ゜ィーゥ ゜ィ ゥ ゜ィ ゥ ス 「「 ョ スス 「「 ス シシ 「「 シシ ョ ロコ゜ン ス ゜ィゥ ス ロ「゜「ン スス ロン ョィ「「ゥ ツ テ ュュュュュ ミ゜ーーー゜ーーアナ゜ーアテカアカケテョクツエアキオキー テュヤコ ッュサ イョ「 テュヤュナコ ュ テュトコ サ イョ「 テ ヘチリ゜テメユヘツモ ス アー ゜ コ ィェャヲゥ タ ス ゜ィ ャ ャ ゥ ス ォ 「゛「 ォ 。ス ヲヲ ョ 。ス ョョ ロン 。ス シシ 「゛「 シシ シシ 「゛「 シシ ロン ゜ィ ゥ ス タ ョ ス ロコ゜ン スス 「゜ココ 。「 スロン 「゜ココ マヒ。「 ス ョィ「「ゥ 」ァ ョ スス 」 シシ 」 オ ョ セ タタヘチリ゜テメユヘツモ ョ゜ィーゥ ゜ィ ゥ ゜ィ ゥ ス 「「 ョ スス 「「 ス シシ 「「 シシ ョ ロコ゜ン ス ゜ィゥ ス タロ「゜「ン スス ロン ョィ「「ゥ ツ テ 」 」 」 ツ ュュュュュ ミ゜ーーー゜ーーアナ゜ーアテカアカケテョクツエアキオキーュュ