Skip to content

Instantly share code, notes, and snippets.

@bitlyfied
Created October 20, 2011 12:33
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 bitlyfied/1301035 to your computer and use it in GitHub Desktop.
Save bitlyfied/1301035 to your computer and use it in GitHub Desktop.
RobotDance (Ruby DSL example)
class RobotDance
def initialize (&block)
instance_eval &block if block
end
def move_arms
puts "swosh!"
end
def shake_booty
puts "shaking my robotic booty"
end
end
RobotDance.new do
move_arms
move_arms
shake_booty
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment