Closed dcrck closed 3 years ago
Ranges implement Enumerable and support in, so you should be able to use them with the {:in, choices} type.
in
{:in, choices}
For example, to check if a value is a byte:
schema = [decimals: [type: {:in, 0..255}]]
This commit adds that support.
Looks good, thanks! We just need a test and I think we are good to go!
/cc @whatyouhide good to you too?
added some tests
Ranges implement Enumerable and support
in
, so you should be able to use them with the{:in, choices}
type.For example, to check if a value is a byte:
This commit adds that support.