From 171f968d227e09443751ced668996bced1fe2f98 Mon Sep 17 00:00:00 2001 From: rhe Date: Sun, 22 Oct 2017 04:19:03 +0000 Subject: [PATCH] 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 --- doc/syntax/methods.rdoc | 6 +++--- 1 file 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: