From: Raj Sahae Date: 2007-03-04T03:21:19+09:00 Subject: Re: attr_reader explained libsfan01 wrote: > can someone explain how attr_reader works? > > i can't find a good explanation anywhere. > > please help! > attr_reader, in it's common usage, creates instance variables and defines a method by which you can read them. Class Test def initialize(num) @test=num end def test @test end end If you were to use attr_reader instead, your class definition would be Class Test attr_reader :test def initialize(num) @test = num end end