A
Allen Dardenelle
HI all, this is my first post in the forum! I got the Ruby and Rails
books for Christmas and I am having a lot of fun with them. But I am
stuck on page 27 in Programming Ruby. I've gotten the code from the web
site and it's not working.
Here is the code:
!#/usr/local/bin/ruby -w
class Song
def to_s
"Song: #@name--#@artist (#@duration)"
end
end
song = Song.new("Bicylops", "Fleck", 260)
song.to_s
Here is my error:
ruby.rb:8:in `initialize': wrong number of arguments (3 for 0)
(ArgumentError)
from ruby.rb:8:in `new'
from ruby.rb:8
books for Christmas and I am having a lot of fun with them. But I am
stuck on page 27 in Programming Ruby. I've gotten the code from the web
site and it's not working.
Here is the code:
!#/usr/local/bin/ruby -w
class Song
def to_s
"Song: #@name--#@artist (#@duration)"
end
end
song = Song.new("Bicylops", "Fleck", 260)
song.to_s
Here is my error:
ruby.rb:8:in `initialize': wrong number of arguments (3 for 0)
(ArgumentError)
from ruby.rb:8:in `new'
from ruby.rb:8