class Veto::GreaterThanCheck
Public Instance Methods
check(attribute, value, errors, options={})
click to toggle source
# File lib/veto/checks/greater_than_check.rb, line 3 def check(attribute, value, errors, options={}) boundary = options.fetch(:with) message = options.fetch(:message, :greater_than) on = options.fetch(:on, attribute) begin v = Kernel.Float(value.to_s) nil rescue return errors.add(on, message, boundary) end unless v > boundary errors.add(on, message, boundary) end end