Skip to content

Commit

Permalink
Add Array#select via aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed Nov 4, 2010
1 parent 3547d94 commit 545162a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/common/array.rb
Expand Up @@ -1316,6 +1316,10 @@ def choice(n=undefined)
result
end

# Some code depends on Array having it's own #select method,
# not just using the Enumerable one. This alias achieves that.
alias_method :select, :find_all

# Removes and returns the first element in the
# Array or nil if empty. All other elements are
# moved down one index.
Expand Down

0 comments on commit 545162a

Please sign in to comment.