From 93bb415516dec2743c61a647532a061e0555501b Mon Sep 17 00:00:00 2001 From: Talal Al-Humaidi <77169738+Talhumaidi@users.noreply.github.com> Date: Mon, 23 Jan 2023 02:48:44 +0000 Subject: [PATCH] [DOC] Change local method to local variable in assignment docs --- doc/syntax/assignment.rdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc index 1321bbf3ac..037c2032a8 100644 --- a/doc/syntax/assignment.rdoc +++ b/doc/syntax/assignment.rdoc @@ -107,7 +107,7 @@ Rather than printing "true" you receive a NameError, "undefined local variable or method `a'". Since ruby parses the bare +a+ left of the +if+ first and has not yet seen an assignment to +a+ it assumes you wish to call a method. Ruby then sees the assignment to +a+ and will assume you are referencing a local -method. +variable. The confusion comes from the out-of-order execution of the expression. First the local variable is assigned-to then you attempt to call a nonexistent