Browse files

impl each_entry

  • Loading branch information...
1 parent c8c3686 commit 7673520110f39caaf0ed65360e530b8a4f42f3ad @no6v committed Jun 6, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 sashimi_friday.rb
View
8 sashimi_friday.rb
@@ -142,7 +142,13 @@ def drop_while
def each_cons
end
- def each_entry
+ def each_entry(*args, &block)
+ return enum_for(__method__, *args) unless block
+ each(*args) do |*item|
+ item = pick(item)
+ block.call(item)
+ end
+ return self
end
def each_slice

0 comments on commit 7673520

Please sign in to comment.