Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

damned ruby blocks

By: a guest on Jul 3rd, 2012  |  syntax: Ruby  |  size: 0.20 KB  |  views: 1,529  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def a(&block)
  2.   ('a'..'zzzz').each do |n|
  3.     begin
  4.       block.binding.eval("#{n} = '#{n}!'")
  5.     rescue Exception
  6.     end
  7.   end
  8. end
  9.  
  10. def z
  11.   asdf = 1
  12.   a{ asde = 2 }
  13.   asdf
  14. end
  15.  
  16. puts z