Skip to content

Instantly share code, notes, and snippets.

@kana
Created December 25, 2008 07:25
Show Gist options
  • Save kana/39867 to your computer and use it in GitHub Desktop.
Save kana/39867 to your computer and use it in GitHub Desktop.
def local(*args)
yield *args
end
x = 100
local 200 do |x|
p x #==> 200
end
p x #==> 100 (1.9) or 200 (1.8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment