Path: csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!talisker.lacave.net!lacave.net!not-for-mail From: Geometric Patterns Newsgroups: comp.lang.ruby Subject: Question regarding interaction between modules and classes Date: Sat, 7 May 2011 22:02:48 -0500 Organization: Service de news de lacave.net Lines: 37 Message-ID: NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1304823873 55381 65.111.164.187 (8 May 2011 03:04:33 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Sun, 8 May 2011 03:04:33 +0000 (UTC) X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 382816 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:4106 Hi, In the code below, is there a way to learn @foo from $bar_one using $bar_two? Many thanks in advance!! ---------------- #!/usr/bin/ruby -w module Foo def setup @foo = self.object_id end def foo return @foo end end class Bar include Foo end $bar_one = Bar.new $bar_one.setup p $bar_one.foo # => 2148224640 $bar_two = Bar.new p $bar_two.foo # => warning: instance variable @foo not initialized ---------------- -- Posted via http://www.ruby-forum.com/.