DryValidation.Types.Integer (dry_validation v1.0.0)

Represents an integer type. Will try to cast strings into integer values.

DryValidation.schema do
  required :age, Types.Integer
end

Link to this section Summary

Functions

Validates that the input value is greater than the value of the first function argument.

Validates that the input value is greater than or equal to the value of the first function argument.

Validates that the input value is less than the value of the first function argument.

Validates that the input value is less than or equal to the value of the first function argument.

Link to this section Functions

Link to this function

greater_than(value)

Validates that the input value is greater than the value of the first function argument.

DryValidation.schema do
  required :age, Types.Integer.greater_than(18)
end
Link to this function

greater_than_or_equal(value)

Validates that the input value is greater than or equal to the value of the first function argument.

DryValidation.schema do
  required :age, Types.Integer.greater_than_or_equal(18)
end
Link to this function

less_than(value)

Validates that the input value is less than the value of the first function argument.

DryValidation.schema do
  required :age, Types.Integer.less_than(100)
end
Link to this function

less_than_or_equal(value)

Validates that the input value is less than or equal to the value of the first function argument.

DryValidation.schema do
  required :age, Types.Integer.less_than_or_equal(100)
end