The code you provided has a few syntax errors. Here's the corrected version:
main.rb112 chars7 lines
Here's what's changed:
def self.song = p file.open('ruby/twelve-days/song.txt', "r").read end
should be def self.song
.File.open
method to the variable file
.read
method on the file
object.Please note that you need to make sure the path 'ruby/twelve-days/song.txt'
is correct for the file you want to read.
gistlibby LogSnag