module CMDx::Validators::Numeric

def call(value, options = {})

def call(value, options = {})
  case options[:numeric]
  in { within: within }
    raise_within_validation_error!(within.begin, within.end, options) unless within.cover?(value)
  in { not_within: not_within }
    raise_not_within_validation_error!(not_within.begin, not_within.end, options) if not_within.cover?(value)
  in { in: yn }
    raise_within_validation_error!(yn.begin, yn.end, options) unless yn.cover?(value)
  in { not_in: not_in }
    raise_not_within_validation_error!(not_in.begin, not_in.end, options) if not_in.cover?(value)
  in { min: min, max: max }
    raise_within_validation_error!(min, max, options) unless value.between?(min, max)
  in { min: min }
    raise_min_validation_error!(min, options) unless min <= value
  in { max: max }
    raise_max_validation_error!(max, options) unless value <= max
  in { is: is }
    raise_is_validation_error!(is, options) unless value == is
  in { is_not: is_not }
    raise_is_not_validation_error!(is_not, options) if value == is_not
  else
    raise ArgumentError, "no known numeric validator options given"
  end
end