Skip to content

Instantly share code, notes, and snippets.

@jqr
Created January 6, 2016 02:00
Show Gist options
  • Save jqr/9699ae38709e576b6d9b to your computer and use it in GitHub Desktop.
Save jqr/9699ae38709e576b6d9b to your computer and use it in GitHub Desktop.
Ruby scope issue with if statements
if false
x = 1
else
puts x.inspect # echos "nil", does not raise exception
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment