Closed ersatzryan closed 10 years ago
:+1:
I am not in favor of using call
specifically because it allows procs if for no other reason than I want Interactor
to be dependably serializable. I also agree with @jasonroelofs's point from the fun argument.
I was looking at the code to submit a PR for this. Do you want to keep around the perform! concept?
Yeah, I think call!
is useful for running interactors in environments where failure should be loud, like in a background process.
Included in the v3
branch.
Interactor's primary public API method is the
perform
class method. Whyperform
? Good question. The answer is because we had to pick something.perform
run
call
execute
work
The suggestion has been made to alias all of these methods and leave it to personal preference. There are two problems with that suggestion:
Proposed Solution
On both the class level and the instance level, interactors will use the
call
method rather thanperform
, because… Ruby. Thecall
method is a common Ruby convention for method objects. It also has nice symmetry with Ruby's procs and lambdas.Fun argument here.