diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-12-27 01:10:30 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-12-27 01:10:30 +0900 |
commit | c452fe17ac679b4171c7de4f4004d61790828ba8 (patch) | |
tree | 666915fc8e07ab316c774b43218d63164b8366b0 | |
parent | 550a49c913f67aba8b89bccd8e4b3296a5c3f599 (diff) | |
download | ruby-c452fe17ac679b4171c7de4f4004d61790828ba8.tar.gz |
[Bug #20087] [DOC] Uninitialized instance variable is not warned now
-rw-r--r-- | doc/syntax/assignment.rdoc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc index e30cb35adf..f45f5bc0ea 100644 --- a/doc/syntax/assignment.rdoc +++ b/doc/syntax/assignment.rdoc @@ -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. |