I am a newbie and am following Programming Ruby 2nd edition. On page 44,
there’s this piece of code,
Now, the following code works fine,
list = SongList.new
list # this works fine, but how ?
What I don’t understand is how is “list” working ? The syntax of the
method specified is “”, so how come can we pass the index
within the braces instead of after it i.e shouldn’t it be “list.”?
But strangely, both work!