From: "Shirai,Kaoru" Date: 2002-07-07T10:09:20+09:00 Subject: Re: passing to objects at the bottom Hi. > i have a chain of objects such that one object contains another which > contains another, and so on, down the line. the top object recieves a > parameter which only the bottom most object in the chain is going to > need. but how do i get it down there with out passing it through all > the rest? and not using a global variable? How about using Environmental Acquisition? (Came from Python.) In Ruby, it is required that the package 'OBAQ' is installed. You can get here: http://devel.p1jp.com/snapshot/obaq-LATEST.tar.gz Let's do same thing to Top/Middle/Bottom example. require 'obaq/option' class Top include Obaq::Acquisition def a "Thanks! I need that." end acq_export_attr :a end class Middle include Obaq::Acquisition end class Bottom include Obaq::Acquisition acq_import :a def put_a puts a end end top = Top.new middle = Middle.new middle.set_outer(top) bottom = Bottom.new bottom.set_outer(middle) bottom.put_a This is very convinient in the situation that it is needed to call the method of far upper objects on object chain. -- shirai@p1jp.com Shirai,Kaoru PlusOne Co.,Ltd