Class: Veto::IsStringCheck

Inherits:
AttributeCheck
  • Object
show all
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, options={})
  on = options.fetch(:on, attribute)
  errors.add(on, options[:message] || MSG) unless value.is_a? String
end