diff options
author | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-22 04:19:03 +0000 |
---|---|---|
committer | rhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-22 04:19:03 +0000 |
commit | 171f968d227e09443751ced668996bced1fe2f98 (patch) | |
tree | f9b601b78904419f52e6b08e4cd5ebb860547ea1 /doc/syntax/methods.rdoc | |
parent | 7fa932ece61667b193c08d035ce634d6dc4a4eaf (diff) | |
download | ruby-171f968d227e09443751ced668996bced1fe2f98.tar.gz |
doc/syntax/methods.rdoc: fix a misleading example
As a bonus, wrap a long line added by r60295.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'doc/syntax/methods.rdoc')
-rw-r--r-- | doc/syntax/methods.rdoc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/syntax/methods.rdoc b/doc/syntax/methods.rdoc index 7d334d5a16..a47c1a3cbf 100644 --- a/doc/syntax/methods.rdoc +++ b/doc/syntax/methods.rdoc @@ -147,14 +147,14 @@ evaluated. 1 + 1 # this expression is never evaluated end -Note that for assignment methods the return value will be ignored when using the assignment syntax. -Instead, the argument will be returned: +Note that for assignment methods the return value will be ignored when using +the assignment syntax. Instead, the argument will be returned: def a=(value) return 1 + value end - p(a = 5) # prints 5 + p(self.a = 5) # prints 5 The actual return value will be returned when invoking the method directly: |