John Maclean wrote:

> Is i) and ii) just two different methods for initialising?
> 
> i)
>  class Song                                                                                                                                
>   attr_reader :name, :artist, :
>  end
> 
> ii) 
> def initialize(foo, blah, haha)
>   @foo = foo
>   @blah = blah
>   @haha = haha
> end  

No, the first is basically the same as this: (Ignoring the syntax error)

class Song
   def name()
     return @name
   end

   def artist()
     return @artist
   end
end

attr_reader, attr_writer and attr_accessor don't touch the initialize() 
method at all. They are just for defining getters and setters because 
instance variables are always private in Ruby. (There's still ways to 
get at them from the outside even without getters through reflection, 
but think before doing that.)

-- 
http://flgr.0x42.net/