Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 3rd, 2012  |  syntax: Ruby  |  size: 0.20 KB  |  views: 114  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def a(&block)
  2.   ('a'..'z').each do |n|
  3.     begin
  4.       block.binding.eval("#{n} = '#{n.upcase}!'")
  5.     rescue Exception
  6.     end
  7.   end
  8. end
  9.  
  10.  
  11. def z
  12.   b = 1
  13.   a{nil}
  14.   b
  15. end
  16.  
  17. puts z
  18. # => B!
clone this paste RAW Paste Data