Skip to content

Conversation

@budu
Copy link

@budu budu commented Sep 12, 2022

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_end option
  • range? predicate in dry-logic
@budu budu requested a review from solnic as a code owner September 12, 2022 02:48
@budu budu changed the title Add support for ranges Add better support for ranges Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant