|
|
|
|
|
by chief
6011 days ago
|
|
I think the article is wrong. His rewrite on line 06. should use if instead of unless. $ irb
>> b
NameError: undefined local variable or method `b' for main:Object
from (irb):1
>> if defined? b
>> b = 5
>> end
=> nil
>> b
=> nil
>> defined? b
=> "local-variable"
|
|
Take this for example:
It just so happens that using statement modifiers in the way I tried using them brings this behavior to light.