Sha256: dd5d08a9f288e68f5ff6aea70ee0a31115ee75ad27f67eaeff843ff7a479cff8
Contents?: true
Size: 518 Bytes
Versions: 4
Compression:
Stored size: 518 Bytes
Contents
module NxtSchema module Validators class LessThanOrEqual < Validator def initialize(threshold) @threshold = threshold end register_as :less_than_or_equal, :lt_or_eql attr_reader :threshold def build lambda do |node, value| if value <= threshold true else message = translate_error(node.locale, value: value, threshold: threshold) node.add_error(message) end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems