Skip to content

Instantly share code, notes, and snippets.

@spastorino
Created October 13, 2010 00:33
Show Gist options
  • Save spastorino/623188 to your computer and use it in GitHub Desktop.
Save spastorino/623188 to your computer and use it in GitHub Desktop.
class Santiago
def method_missing(method_id, *args)
p "method_missing"
self.class.class_eval do # do instead of here doc string
def #{method_id}(*args)
p "hello"
end
end # end of block instead of closing the string
send(method_id, *args)
end
end
Santiago.new.hello
Santiago.new.hello
Santiago.new.hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment