Guest User

Untitled

a guest
Jun 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. class Santiago
  2. def method_missing(method_id, *args)
  3. p "method_missing"
  4. self.class.class_eval do # do instead of here doc string
  5. def #{method_id}(*args)
  6. p "hello"
  7. end
  8. end # end of block instead of closing the string
  9. send(method_id, *args)
  10. end
  11. end
  12.  
  13. Santiago.new.hello
  14. Santiago.new.hello
  15. Santiago.new.hello
Add Comment
Please, Sign In to add comment