dry-rb / dry-logic

Predicate logic with rule composition

Home Page:https://dry-rb.org/gems/dry-logic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nil input causes predicate errors

fran-worley opened this issue · comments

Moved from dry-validation see dry-rb/dry-validation#150

For :includes and :excludes and predicates I propose the following handling of nil and unsupported input types (e.g. Integers)

Includes should return false as the input cannot include the desired value
Excludes should return true as for the same reason as the above.

A greater discussion should be had around other predicates where this may apply (e.g. :gt, :lt etc.)

@fran-worley interface checking is the right thing to do. 👍