From: Judson Lester Date: 2009-11-14T05:30:15+09:00 Subject: Re: Module with a class? --001636e0b727f2b77104784686a2 Content-Type: text/plain; charset=UTF-8 On Fri, Nov 13, 2009 at 10:48 AM, Matt Brooks wrote: > I may need to reexplain it, but basically want classes in different > files, but want the other classes to have access to 1 core files' > objects instance variables and methods, since this core object will be > creating the other objects of the other classes in the other files.... > > Some example code would help a lot. File boudaries notwithstanding it sounds like you have something like: class Hello def say puts "Hello" end end class Core def initialize @hello=nil end attr_reader :hello def add_hello_widget @hello= Hello.new end end core = Core.new core.add_hello_widget core.hello.say #=> "Hello" Something like that? If not, what's missing? Judson --001636e0b727f2b77104784686a2--