[Bug #20087] [DOC] Uninitialized instance variable is not warned now
This commit is contained in:
parent
550a49c913
commit
c452fe17ac
@ -162,9 +162,7 @@ Here is an example of instance variable usage:
|
|||||||
p object1.value # prints "some value"
|
p object1.value # prints "some value"
|
||||||
p object2.value # prints "other value"
|
p object2.value # prints "other value"
|
||||||
|
|
||||||
An uninitialized instance variable has a value of +nil+. If you run Ruby with
|
An uninitialized instance variable has a value of +nil+.
|
||||||
warnings enabled, you will get a warning when accessing an uninitialized
|
|
||||||
instance variable.
|
|
||||||
|
|
||||||
The +value+ method has access to the value set by the +initialize+ method, but
|
The +value+ method has access to the value set by the +initialize+ method, but
|
||||||
only for the same object.
|
only for the same object.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user