Skip to content

Instantly share code, notes, and snippets.

@gnufied
Created June 13, 2012 09:14
Show Gist options
  • Save gnufied/2922972 to your computer and use it in GitHub Desktop.
Save gnufied/2922972 to your computer and use it in GitHub Desktop.
class Leaky
def wow
locations = [1,2,3]
locs = Hash.new(0)
locations.each do |x|
number = 10
p number
end
p number
end
end
Leaky.new().wow() #=> throws undefined local variable or method `number`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment