Skip to content

Commit

Permalink
[Bug #20087] [DOC] Uninitialized instance variable is not warned now
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 26, 2023
1 parent 550a49c commit c452fe1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions doc/syntax/assignment.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ Here is an example of instance variable usage:
p object1.value # prints "some value"
p object2.value # prints "other value"

An uninitialized instance variable has a value of +nil+. If you run Ruby with
warnings enabled, you will get a warning when accessing an uninitialized
instance variable.
An uninitialized instance variable has a value of +nil+.

The +value+ method has access to the value set by the +initialize+ method, but
only for the same object.
Expand Down

0 comments on commit c452fe1

Please sign in to comment.