From: "Paatsch, Bernd" Date: 2006-01-25T09:56:33+09:00 Subject: Re: How to access a attributes from the parent class? ------_=_NextPart_001_01C6214A.1AC9B2A6 Content-Type: text/plain Great :), it works! -----Original Message----- From: Gennady Bystritsky [mailto:Gennady.Bystritsky@quest.com] Sent: Tuesday, January 24, 2006 4:50 PM To: ruby-talk ML Subject: Re: How to access a attributes from the parent class? You must call super in WacSubProfile#initialize to invoke WacSubscribers#initialize. Gennady. -----Original Message----- From: Paatsch, Bernd [mailto:BPaatsch@activevoice.com] Sent: Tuesday, January 24, 2006 16:45 To: ruby-talk ML Subject: How to access a attributes from the parent class? I am new to ruby and try to figure out how inheritance works. I don't get the result I expect. I marked the line of code with "#error". What do I need to do to get it to work? class WacFrames attr_reader :wacFrameNav attr_reader :wacFrameDisp def initialize() @wacFrameNav = "nav" @wacFrameDisp = "disp" end end class WacSubscribers attr_reader :fr attr_reader :frame def initialize() @fr = WacFrames.new() @frame = @fr.wacFrameNav end end class WacSubProfile < WacSubscribers def initialize() #some code end end end another = WacSubscribers.new() puts another.fr #works fine puts another.frame #works fine test = WacSubProfile.new() puts test.fr #error puts test.frame #error Thanks ------_=_NextPart_001_01C6214A.1AC9B2A6--