Class: Veto::IntegerCheck
- Inherits:
-
AttributeCheck
- Object
- Check
- AttributeCheck
- Veto::IntegerCheck
- Defined in:
- lib/veto/checks/integer_check.rb
Instance Method Summary collapse
Methods inherited from AttributeCheck
Methods inherited from Check
Constructor Details
This class inherits a constructor from Veto::AttributeCheck
Instance Method Details
#check(attribute, value, errors, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/veto/checks/integer_check.rb', line 3 def check(attribute, value, errors, ={}) = .fetch(:message, :integer) on = .fetch(:on, attribute) begin Kernel.Integer(value.to_s) nil rescue errors.add(on, ) end end |