Skip to content

Instantly share code, notes, and snippets.

@kirel
Created July 29, 2008 11:24
Show Gist options
  • Save kirel/3068 to your computer and use it in GitHub Desktop.
Save kirel/3068 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
class A
def dsl &block
puts "dsl active"
instance_eval &block
end
private
def priv
puts "This is private - please stay out"
end
def method_missing(m, *arg)
puts "I #{m} #{arg.first}."
end
end
a = A.new
a.dsl do
priv
write "something"
yell "something"
scream "something"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment