summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-12 11:09:10 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-12 11:09:10 (GMT)
commita100bf321c7f3a6eb97133735f5d73a1fc92a405 (patch)
tree9223c3223159100b0f942dec36772a04fdab0bbd /array.c
parent3b405a8912b5762197cdec9f78f040956640830b (diff)
array.c: [DOC] Make it clear that #<< modifies receiver
This patch is sent from @selmertsx (morioka shuhei). [fix GH-1646] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/array.c b/array.c
index bd13a53..278789d 100644
--- a/array.c
+++ b/array.c
@@ -910,7 +910,10 @@ ary_take_first_or_last(int argc, const VALUE *argv, VALUE ary, enum ary_take_pos
* expression returns the array itself, so several appends
* may be chained together.
*
- * [ 1, 2 ] << "c" << "d" << [ 3, 4 ]
+ * a = [ 1, 2 ]
+ * a << "c" << "d" << [ 3, 4 ]
+ * #=> [ 1, 2, "c", "d", [ 3, 4 ] ]
+ * a
* #=> [ 1, 2, "c", "d", [ 3, 4 ] ]
*
*/