R
Ricardo Amorim
Howdy,
I have noticed this a while ago and someone asked in IRC, and I have
no clue on WHY this happens:
irb(main):001:0> local_var
NameError: undefined local variable or method `local_var' for main:Object
from (irb):1
irb(main):002:0> @local_var
=> nil
Why are instance_variables always available as nil when not defined?
Regards,
Ricardo Amorim
mapaBRASIL.net
I have noticed this a while ago and someone asked in IRC, and I have
no clue on WHY this happens:
irb(main):001:0> local_var
NameError: undefined local variable or method `local_var' for main:Object
from (irb):1
irb(main):002:0> @local_var
=> nil
Why are instance_variables always available as nil when not defined?
Regards,
Ricardo Amorim
mapaBRASIL.net