Last active
August 29, 2015 14:01
-
-
Save mpelzsherman/259f34de1d5172d350c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class House | |
PHRASES = [ | |
"the horse and the hound and the horn that belonged to", | |
"the farmer sowing his corn that kept", | |
"the rooster that crowed in the morn that woke", | |
"the priest all shaven and shorn that married", | |
"the man all tattered and torn that kissed", | |
"the maiden all forlorn that milked", | |
"the cow with the crumpled horn that tossed", | |
"the dog that worried", | |
"the cat that killed", | |
"the rat that ate", | |
"the malt that lay in", | |
"the house that Jack built" | |
] | |
def line number | |
"This is #{PHRASES.last(number).join(" ")}.\n" | |
end | |
def recite | |
1.upto(PHRASES.count).inject('') {|result, number| result << "#{line(number)}\n"} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment