dry-rb / dry-logic

Predicate logic with rule composition
https://dry-rb.org/gems/dry-logic/
MIT License
179 stars 66 forks source link

`respond_to?` predicate needs to be renamed #73

Closed dgutov closed 1 year ago

dgutov commented 4 years ago

As discussed in https://github.com/dry-rb/dry-logic/pull/55, its current name overrides Object#respond_to? in an incompatible fashion.

We can rename it to responds_to?, for example. Just like includes? delegates to include?.

etiennebarrie commented 2 years ago

The same issue exists with eql?.

h = {}
o = Object.new
def o.hash
  Dry::Logic::Predicates.hash
end
h[o] = true
h[Dry::Logic::Predicates]
# ! => lib/dry/logic/predicates.rb:181:in `eql?': wrong number of arguments (given 1, expected 2) (ArgumentError)