Skip to content
Permalink
Browse files

Merge pull request #858 from kachick/enumerator-tweaks

Enumerator tweaks
  • Loading branch information
kachick committed Oct 25, 2015
2 parents 04d3bcc + d136afe commit a126ae29b75abcf3a3833a8bff5b987741c50173
@@ -7,6 +7,7 @@ def initialize(obj = nil, method = :each, *args, &block)
@object = obj
@method = method.to_sym
@args = args
self
end

def each(&block)
@@ -91,8 +92,11 @@ def with_object(obj, &block)
end

class Generator
include Enumerable

def initialize(&block)
@block = block
self
end

def each
@@ -104,6 +108,7 @@ def each
class Yielder
def initialize(&block)
@block = block
self
end

def yield(*args)

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit a126ae2

Please sign in to comment.