I almost built that in on the first go, but figured I'd wait until someone needed it.

:hourglass:

Wait's over!

> On Aug 25, 2013, at 10:52 AM, Daniel Morrison <notifications@github.com> wrote:
> 
> In lib/interactor/iterator.rb:
> 
> > +      def collection
> > +        @collection
> > +      end
> > +
> > +      def collect(key)
> > +        @collection = key
> > +      end
> > +    end
> > +
> > +    module InstanceMethods
> > +      def collection
> > +        context.fetch(self.class.collection, [])
> > +      end
> > +
> > +      def perform
> > +        collection.each do |(*element)|
> In the first example of refactoring one of my interactors to be an interator, I realized I'm using each_with_index. If we did that here, it wouldn't break the normal case, but allows you to grab the index var if you want it. Thoughts?
> 
> —
> Reply to this email directly or view it on GitHub.