Skip to content

Commit

Permalink
[DOC] Change local method to local variable in assignment docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Talhumaidi committed Jan 23, 2023
1 parent 8fded5f commit 93bb415
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/syntax/assignment.rdoc
Expand Up @@ -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
Expand Down

0 comments on commit 93bb415

Please sign in to comment.