Skip to content
Permalink
Browse files

Merge pull request #600 from kostya/each_entry

enumerable#each_entry
  • Loading branch information
alex committed Apr 10, 2013
2 parents 15bb0ec + 72c652e commit 30b161cff5e9f960f074af13b0684054c84d633d
Showing with 9 additions and 5 deletions.
  1. +9 −0 lib-topaz/enumerable.rb
  2. +0 −5 spec/tags/core/enumerable/each_entry_tags.txt
@@ -61,6 +61,15 @@ def each_with_object(memo, &block)
memo
end

def each_entry(*args, &block)
return self.enum_for(:each_entry, *args) unless block
each(*args) do |*e|
v = (e.size == 1) ? e[0] : e
yield v
end
self
end

def all?(&block)
self.each do |obj|
return false unless (block ? block.call(obj) : obj)

This file was deleted.

0 comments on commit 30b161c

Please sign in to comment.
You can’t perform that action at this time.