Skip to content

Commit

Permalink
Add Enumerable#member?
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Sep 26, 2013
1 parent b44aa64 commit bed49d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions corelib/enumerable.rb
Expand Up @@ -622,6 +622,10 @@ def min(&block)
}
end

def member?(obj)
any? { |v| v == obj }
end

def none?(&block)
%x{
var result = true,
Expand Down

0 comments on commit bed49d2

Please sign in to comment.