Check this out for a good explanation of attr_reader
, attr_writer
, and attr_accessor
.
And check this out for learning how to add parameters to the constructor.
You could have :attr_accessor :artists
inside Song
and in initialize
do this:
@artists = Array.new
Then you can have a method add
:
def add(artist)
@artists << artist
end
Just an idea. Always happy to help a Drake fan.