Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better support for ranges #449

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant