From: James Britt Date: 2006-01-07T00:31:56+09:00 Subject: Re: Confirmation required - initialising James Edward Gray II wrote: > On Jan 6, 2006, at 8:20 AM, John Maclean wrote: > >> Is i) and ii) just two different methods for initialising? >> >> i) >> class Song >> attr_reader :name, :artist, : >> end > > > If you remove the trailing , and :, the above is equivalent to: > > class Song > def name > @name > end > def artist > @artist > end > end > Except that rdoc produces different output for each. James -- http://www.ruby-doc.org - Ruby Help & Documentation http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys http://www.30secondrule.com - Building Better Tools