Created
March 14, 2010 11:30
-
-
Save iain/331926 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
# Writing Genesis in Ruby, for http://www.whatdigitalrevolution.com/?p=119 | |
God = "God" | |
def God.performs &acts | |
instance_eval &acts | |
end | |
def God.create *stuff | |
"#{self} created #{stuff.join(' and ')}." | |
end | |
def God.rests | |
"#{self} rested" | |
end | |
module TimeLine | |
def day number, &acts | |
puts "On day #{number}, #{God.performs(&acts)} and #{self} saw that it was good." | |
end | |
end | |
class Creation | |
extend TimeLine # time was apparently already there | |
day 1 do | |
create :Heaven, :Earth | |
create :Light | |
end | |
day 2 do | |
create :Firmament | |
end | |
# etc... | |
day 6 do | |
create :Beast | |
create :Man | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment