From: Shashank Date Date: 2004-04-06T06:28:08+09:00 Subject: Re: object.@attribute --- rolo wrote: > Why cannot we have attribute access of the object > from anywhere in the program by sennding a message > @attribute > > class Example > def initialize > @number = '1.0' > end > end > > e = Example.new > print e.@number => should print 1.0 Would this work for you? class Example attr_reader :number def initialize @number = '1.0' end end e = Example.new puts e.number #=> will print 1.0 __________________________________ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/