Funx.Validator.LessThanOrEqual (funx v0.8.2)

View Source

Validates that a value is less than or equal to a given reference value using an Ord comparator.

Options

  • :value (required) - The reference value to compare against
  • :ord (optional) - An ordering comparator. Defaults to Funx.Ord.Protocol
  • :message (optional) - Custom error message callback (value -> String.t())

Semantics

  • If the value compares as :lt or :eq relative to the reference, validation succeeds.
  • If the value compares as :gt, validation fails.
  • Nothing values pass unchanged.
  • Just values are unwrapped before comparison.

Summary

Functions

validate(value)

validate(value, opts)