Skip to content

Instantly share code, notes, and snippets.

@iain
Created March 14, 2010 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iain/331926 to your computer and use it in GitHub Desktop.
Save iain/331926 to your computer and use it in GitHub Desktop.
# 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