B
Ben Edwards
Working through the Pickax Ruby programing book and cant get the
following example 'compile':-
irb(main):040:0* class SongList
irb(main):041:1> MAX_TIME = 5*60 # 5 minutes
irb(main):042:1>
irb(main):043:1* def Songlist.is_too_long(song)
irb(main):044:2> return song.duration > MAX_TIME
irb(main):045:2> end
irb(main):046:1> end
(irb):41: warning: already initialized constant MAX_TIME
NameError: uninitialized constant SongList::Songlist
from (irb):43
from :0
Any idea why?
Ben
--
Ben Edwards - Bristol, UK
http://www.flickr.com/photos/41303704@N00/ - have a look at my pics
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)
following example 'compile':-
irb(main):040:0* class SongList
irb(main):041:1> MAX_TIME = 5*60 # 5 minutes
irb(main):042:1>
irb(main):043:1* def Songlist.is_too_long(song)
irb(main):044:2> return song.duration > MAX_TIME
irb(main):045:2> end
irb(main):046:1> end
(irb):41: warning: already initialized constant MAX_TIME
NameError: uninitialized constant SongList::Songlist
from (irb):43
from :0
Any idea why?
Ben
--
Ben Edwards - Bristol, UK
http://www.flickr.com/photos/41303704@N00/ - have a look at my pics
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)