On Wed, 7 Feb 2001, Dave Thomas wrote: > Jim Freeze <jim / freeze.org> writes: > > > module Notes > > attr :concertA > > def tuning(amt) > > @concertA = 440.0 + amt > > end > > end > > > I don't understand where the instance method 'concertA' is defined. I see > > that the instance variable '@concertA' is defined. > > the 'attr' line defines an accessor method (called concertA) for the > instance variable @concertA. > hmmm...I'm used to using attr_accessor, attr_reader or attr_writer. Is attr an alias for attr_accessor (or visa-versa?) Also, on page 234, is the 'writable' a typo? If not, what does it do and how is it used? class name attr attribute [, writable] attr_reader attribute [, attribute]... ... end Many thanks ==================================================== Jim Freeze jim / freeze.org --------------------------------------------------- ** http://www.freeze.org ** ====================================================