From b89a3e7e638a50c648a17d09c48b49b707e1d90d Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sun, 31 Mar 2019 08:38:37 +0900 Subject: Tweaks CHANGELOGs and docs [ci skip] * add leading `#` before `=>` since hash rocket is valid Ruby code * add backticks * remove trailing spaces * and more --- activesupport/lib/active_support/core_ext/array/access.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/array/access.rb b/activesupport/lib/active_support/core_ext/array/access.rb index 10e4c6b09d..ea01e5891c 100644 --- a/activesupport/lib/active_support/core_ext/array/access.rb +++ b/activesupport/lib/active_support/core_ext/array/access.rb @@ -31,16 +31,16 @@ class Array # Returns a new array that includes the passed elements. # - # [ 1, 2, 3 ].including(4, 5) => [ 1, 2, 3, 4, 5 ] - # [ [ 0, 1 ] ].including([ [ 1, 0 ] ]) => [ [ 0, 1 ], [ 1, 0 ] ] + # [ 1, 2, 3 ].including(4, 5) # => [ 1, 2, 3, 4, 5 ] + # [ [ 0, 1 ] ].including([ [ 1, 0 ] ]) # => [ [ 0, 1 ], [ 1, 0 ] ] def including(*elements) self + elements.flatten(1) end # Returns a copy of the Array excluding the specified elements. # - # ["David", "Rafael", "Aaron", "Todd"].excluding("Aaron", "Todd") => ["David", "Rafael"] - # [ [ 0, 1 ], [ 1, 0 ] ].excluding([ [ 1, 0 ] ]) => [ [ 0, 1 ] ] + # ["David", "Rafael", "Aaron", "Todd"].excluding("Aaron", "Todd") # => ["David", "Rafael"] + # [ [ 0, 1 ], [ 1, 0 ] ].excluding([ [ 1, 0 ] ]) # => [ [ 0, 1 ] ] # # Note: This is an optimization of Enumerable#excluding that uses Array#- # instead of Array#reject for performance reasons. -- cgit v1.2.3