1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[DOC] mention assignment expression values

This commit is contained in:
Nobuyoshi Nakada 2022-04-25 23:49:58 +09:00
parent 45cf4f2187
commit 5701b4084e
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -8,6 +8,9 @@ example assigns the number five to the local variable +v+:
Assignment creates a local variable if the variable was not previously
referenced.
An assignment expression result is always the assigned value, including
{assignment methods}[rdoc-ref:syntax/assignment.rdoc@Assignment+Methods].
== Local Variable Names
A local variable name must start with a lowercase US-ASCII letter or a
@ -342,6 +345,9 @@ This prints:
local_variables:
@value: 42
Note that the value returned by an assignment method is ignored whatever,
since an assignment expression result is always the assignment value.
== Abbreviated Assignment
You can mix several of the operators and assignment. To add 1 to an object