Skip to content

Instantly share code, notes, and snippets.

@mjgiarlo
Created July 8, 2015 17:37
Show Gist options
  • Save mjgiarlo/73875366bc7e743ce4d8 to your computer and use it in GitHub Desktop.
Save mjgiarlo/73875366bc7e743ce4d8 to your computer and use it in GitHub Desktop.
automatic nilification
[1] pry(main)> var1 = 'value1' if false
=> nil
[2] pry(main)> var1
=> nil
[3] pry(main)> if false
[3] pry(main)* var2 = 'value2'
[3] pry(main)* end
=> nil
[4] pry(main)> var2
=> nil
[5] pry(main)> var3
NameError: undefined local variable or method `var3' for main:Object
from (pry):7:in `__pry__'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment