dry-types
dry-types copied to clipboard
Add better support for ranges
Hi, I'd like to use dry-schema for an application dealing with lots of ranges. The current support for ranges in dry-types doesn't handle checks for its member values, which is the issue this PR is trying to solve.
I've based my work on the current implementation for arrays and tried to include everything from test to documentation. Coding was pretty straightforward considering I don't have much experience with dry libraries.
Here's an example of using this feature:
IntegerRange = Types::Range.of(Types::Coercible::Integer)
IntegerRange[1.0..2.0] # 1..2
Things to improve
- support for
exclude_endoption -
range?predicate in dry-logic