Guest User

Untitled

a guest
Feb 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. >> def awesome
  2. >> x = 7
  3. >> proc { self * x }
  4. >> end
  5. => nil
  6. >> awesome
  7. => #<Proc:0x00368b84@(irb):3>
  8. >> awesome[]
  9. NoMethodError: undefined method `*' for main:Object
  10. from (irb):3:in `awesome'
  11. from (irb):6:in `[]'
  12. from (irb):6
  13. from :0
  14. >> 12.instance_eval(&awesome)
  15. => 84
Add Comment
Please, Sign In to add comment