collectiveidea/interactor — pull request #12 by laserlemon (2013-08-25 13:10:02+00:00)
Title: Add "iterator" interactors

Iterators are like basic interactors in that they do *one* thing. Iterators just do that one thing several times.

```ruby
class SendInvitations
include Interactor::Iterator

collect :email_addresses

def perform_each(email_address)
Notifier.invitation(email_address).deliver
end
end
```

The `collect` method specifies at which key in the context the collection can be found. Each element in the collection is passed into the `perform_each` method. If any iteration fails, the successful iterations are rolled back (in reverse) using the `rollback_each` method.

I'd like to hear thoughts on the interactor DSL. I tried a quite a few variations and this felt pretty darn close. /cc @emilford, @ersatzryan, @pichot, @danielmorrison, @jasonroelofs