Wanted to get an idea if something like this would be an acceptable change.
Basically, I would like to use an Interactor and do some extra work if the called Interactor is successful. Having call! update the calling context when Interactor::Failure is called makes this much cleaner. For example before you would write,
class Old
include Interactor
def call
# do work
result = Other.call
if result.success?
# do more work
else
context.fail!(...)
end
end
end
Now you do not have to check if the call was successful.
class New
include Interactor
def call
# do work
Other.call!
# do more work
end
end
This code doesn't make it clear enough in my mind that anything is being merged. Plus, the call! method has been taken now so closing this for the time being.
Wanted to get an idea if something like this would be an acceptable change.
Basically, I would like to use an
Interactor
and do some extra work if the calledInteractor
is successful. Havingcall!
update the calling context whenInteractor::Failure
is called makes this much cleaner. For example before you would write,Now you do not have to check if the call was successful.
Maybe this can be done in
Organizer
s?