Skip to content

Instantly share code, notes, and snippets.

@cupakromer
Last active December 24, 2015 14:39
Show Gist options
  • Save cupakromer/6814650 to your computer and use it in GitHub Desktop.
Save cupakromer/6814650 to your computer and use it in GitHub Desktop.
# Ruby's World
# Runs this code
puts self # => main
# Runs this code
module ChangeMyWorld
# The Worls is now changed
# Runs this code
puts self # => ChangeMyWorld
# Runs this creation of a method
def self.do_something
# Doesn't run this code right now
# => saves this stuff to do later
end
end
# Exits the world
# Runs this code
puts self # => main
# Runs this code
ChangeMyWorld.do_something # => Now runs the code saved as "do_something" in the world ChangeMyWorld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment