-
Notifications
You must be signed in to change notification settings - Fork 3
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
Introduce minimum, maximum and numeric types #25
Introduce minimum, maximum and numeric types #25
Conversation
README.md
Outdated
@@ -500,6 +503,12 @@ Returns ValidResult if and only if provided value is an integer. Doesn't transfo | |||
|
|||
I18n keys: `error_key`, `'.integer'`, `'datacaster.errors.integer'`. | |||
|
|||
#### `numeric(error_key = nil)` | |||
|
|||
Returns ValidResult if and only if provided value is a number. Doesn't transform the value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"provided value is a number (Ruby's Numeric
)"
README.md
Outdated
@@ -523,6 +532,26 @@ I18n keys: | |||
* not an integer – `error_key`, `'.integer'`, `'datacaster.errors.integer'` | |||
* too big – `error_key`, `'.integer32'`, `'datacaster.errors.integer32'` | |||
|
|||
#### `maximum(max, error_key = nil, inclusive: true)` | |||
|
|||
Returns ValidResult if and only if provided value is a number and is less than specified. Doesn't transform the value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns ValidResult if and only if provided value is a number and is less than `max`. If `inclusive` set to true, provided value should be less than or equal to `max`.
README.md
Outdated
|
||
#### `minimum(min, error_key = nil, inclusive: true)` | ||
|
||
Returns ValidResult if and only if provided value is a number and is greater than specified. Doesn't transform the value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns ValidResult if and only if provided value is a number and is greater than `min`. If `inclusive` set to true, provided value should be greater than or equal to `min`.
``
lib/datacaster/version.rb
Outdated
@@ -1,3 +1,3 @@ | |||
module Datacaster | |||
VERSION = "4.1.0" | |||
VERSION = "4.1.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4.2.0
Introduce minimum, maximum and numeric types