From c452fe17ac679b4171c7de4f4004d61790828ba8 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 27 Dec 2023 01:10:30 +0900 Subject: [Bug #20087] [DOC] Uninitialized instance variable is not warned now --- doc/syntax/assignment.rdoc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'doc/syntax') 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. -- cgit v1.2.3