Displaying 1 result from an estimated 1 matches for "deletelast".
Did you mean:
deletedest
2006 Apr 08
1
help : uninitialized constant Song
...ant B error..Any idea how to over come this.
Here is my code.
--------------------
class SongList
#initialize the array
def initialize
@songs=Array.new
end
def aSong(aSong)
@songs.push(aSong)
self
end
def deleteFirst
@songs.shift
end
def deleteLast
@songs.pop
end
end
list =SongList.new
list.
append(Song.new(''title1'', ''artist1'', 1)).
append(Song.new(''title2'', ''artist2'', 2)).
append(Song.new(''title3'', ''artist3'', 3...