Closed CandyFet closed 2 years ago
How about interface?(:foo)
- it would be consistent with dry-types where we have Types.Interface(:foo)
How about
interface?(:foo)
- it would be consistent with dry-types where we haveTypes.Interface(:foo)
I am not very familiar with dry gems yet. But i'll look deeply and will add code that ensures successful behaviour with Types.Interface
@solnic Do you mean to suggest using interface?
as the name instead of responds_to?
?
It might work (especially it it's going to accept multiple arguments). responds_to?
is a much more obvious name, though.
IMO, this only adds confusion. The ruby convention uses the infinitive form (has_key?
-> have_key?
). Either interface?
or method?
would work I think
I'd be OK with either interface?
or method?
too.
IMO, this only adds confusion. The ruby convention uses the infinitive form (has_key? -> have_key?)
I'm following the precedent made by includes?
: https://github.com/dry-rb/dry-logic/blob/9e6d7762664b9bc99a4aa4f6f0e7fb8d7a8800ee/lib/dry/logic/predicates.rb#L184-L192
Either interface? or method? would work I think
I don't have a strong opinion (anything would be better than the status quo), but someone might mistake method?
for implying the use of Module#method_defined?
.
Ah yeah, I guess includes?
wasn't a good choice either 😬
At this point (two years later), I'd say any choice is good enough. As long as it's a change. :-)
Though I guess this particular PR might limit itself to adding a new predicate (in a minor version), for you to remove the obsolete one in the new major (?) version.
I'm gonna go with interface?
because we already have Types.Interface
in dry-types so this would be consistent.
Closing after all as this was done via #99
PR for issue 73