Class: Veto::IsStringCheck
- Inherits:
-
AttributeCheck
- Object
- AttributeCheck
- Veto::IsStringCheck
- Defined in:
- lib/veto_checks.rb
Constant Summary collapse
- MSG =
"is not a string"
Instance Method Summary collapse
Instance Method Details
#check(attribute, value, errors, options = {}) ⇒ Object
18 19 20 21 |
# File 'lib/veto_checks.rb', line 18 def check(attribute, value, errors, ={}) on = .fetch(:on, attribute) errors.add(on, [:message] || MSG) unless value.is_a? String end |