N
Navya Amerineni
Hi caio,
thanks for your valuble suggestion and it works
great.I have one another silly question
this is the code
class Song
def initialize(name, artist, duration)
@name=name
@artist=artist
@duration=duration
end
def myclass_function
puts "this is my first class"
end
def to_s
puts "Song: #@name--#@artist (#@duration)"
end
end
class Karaokesong
def initialize(name, artist, duration, lyrics)
super(name, artist, duration)
@lyrics=lyrics
end
def to_s
puts "Song: #@name--#@artist (#@duration)"
end
end
the following is the error
"myfirstprojectfile:16:in `initialize': wrong number
of arguments (3 for 0) (ArgumentError)"
the error is with super.
can you explain why it is.
Regards,
Navya.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
thanks for your valuble suggestion and it works
great.I have one another silly question
this is the code
class Song
def initialize(name, artist, duration)
@name=name
@artist=artist
@duration=duration
end
def myclass_function
puts "this is my first class"
end
def to_s
puts "Song: #@name--#@artist (#@duration)"
end
end
class Karaokesong
def initialize(name, artist, duration, lyrics)
super(name, artist, duration)
@lyrics=lyrics
end
def to_s
puts "Song: #@name--#@artist (#@duration)"
end
end
the following is the error
"myfirstprojectfile:16:in `initialize': wrong number
of arguments (3 for 0) (ArgumentError)"
the error is with super.
can you explain why it is.
Regards,
Navya.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com