richard
September 21st, 2005, 11:49 PM
Starting the book "programming ruby" This doen't return what the author states. I've changes the vaiables but nothing else. Any thoughts?
class Song
def initialize(name, artest, duration)
@name = name
@artest = artest
@duration = duration
end
end
Song = Song.new("Over My Head", "The Fray", 356)
Song.inspect
produces
>ruby song.rb
song.rb:9: warning: already initialized constant Song
>Exit code: 0
class Song
def initialize(name, artest, duration)
@name = name
@artest = artest
@duration = duration
end
end
Song = Song.new("Over My Head", "The Fray", 356)
Song.inspect
produces
>ruby song.rb
song.rb:9: warning: already initialized constant Song
>Exit code: 0