hanami / utils

Ruby core extentions and class utilities for Hanami

Home Page:http://hanamirb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interactor uses gramatically wrong terms for success/failure

yjukaku opened this issue · comments

Thank you for your work on this project!

When an Interactor call was a success, we check with either

result = Signup.new().call
result.success?
# OR
result.successful?

but we check failure with

result.failing?

This doesn't make grammatic sense, because the opposite of success? would be failure? and the opposite of successful? would still be failure?. However, failing? is definitely not correct, because its opposite would be succeeding?.

I think this is quite confusing, even though it is a small nitpick. Maybe failing? could be deprecated and aliased to failure??

Thoughts? Thanks again!

I agree failing? is awkward. I think we should switch it to failure?.

Interactor just added this convenience method. 😅 #148.

It looks like the original PR had it as failure? but it got switched to failing? by @jodosha :)

Thank you for opening this Issue. Now (pre-1.0) is the perfect time to fix these small things that improve the API :)

I agree with that change, I think we should use failure? instead failing?

@yjukaku Feel free to open a PR for this change, if you have time :)