dry-rb / dry-logic

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

Minimise errors when using includes & excludes #11

Closed fran-worley closed 8 years ago

fran-worley commented 8 years ago

If includes is called on an input that supports the method then call it, otherwise return false.

If we encounter a type error (e.g. String.include?(Integer) ) then also return false.

Due to the enhanced complexity of the predicate lets make excludes? simply be its opposite.

Fixes https://github.com/dry-rb/dry-logic/issues/10

jodosha commented 8 years ago

@fran-worley 👍