summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-10-14 18:56:12 +0900
committerGitHub <[email protected]>2019-10-14 18:56:12 +0900
commitdc474b625be16520032999773f6ecf407de42a90 (patch)
treeee73017170f2e2bf9d0196cdff6794f65bc6c9d7
parentbdacdfaea9bf4b52770c32d60b7d402b48297c58 (diff)
parentac29638a8ac5ba25d4004c06e25074d1c1503a99 (diff)
downloadmruby-dc474b625be16520032999773f6ecf407de42a90.tar.gz
mruby-dc474b625be16520032999773f6ecf407de42a90.zip
Merge pull request #4773 from shuujii/fix-the-example-of-Array-intersection-in-the-document
Fix the example of `Array#intersection` in the document [ci skip]
-rw-r--r--mrbgems/mruby-array-ext/mrblib/array.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/mrbgems/mruby-array-ext/mrblib/array.rb b/mrbgems/mruby-array-ext/mrblib/array.rb
index be1676666..5492ba2eb 100644
--- a/mrbgems/mruby-array-ext/mrblib/array.rb
+++ b/mrbgems/mruby-array-ext/mrblib/array.rb
@@ -178,10 +178,10 @@ class Array
# ary.intersection(other_ary,...) -> new_ary
#
# Set Intersection---Returns a new array containing elements common to
- # this array and <i>other_ary</i>, removing duplicates.
+ # this array and <i>other_ary</i>s, removing duplicates. The order is
+ # preserved from the original array.
#
- # ["a", "b", "c"].union(["c", "d", "a"], ["a", "c", "e"])
- # #=> ["a", "b", "c", "d", "e"]
+ # [1, 2, 3].intersection([3, 4, 1], [1, 3, 5]) #=> [1, 3]
#
def intersection(*args)
ary = self