class Veto::IntegerCheck
Public Instance Methods
check(attribute, value, errors, options={})
click to toggle source
# File lib/veto/checks/integer_check.rb, line 3 def check(attribute, value, errors, options={}) message = options.fetch(:message, :integer) on = options.fetch(:on, attribute) begin Kernel.Integer(value.to_s) nil rescue errors.add(on, message) end end