Class: SimplyStored::Couch::Validations::ValidatesFormatOf
- Inherits:
-
Validatable::ValidationBase
- Object
- Validatable::ValidationBase
- SimplyStored::Couch::Validations::ValidatesFormatOf
- Defined in:
- lib/simply_stored/couch/validations.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#i18n ⇒ Object
38 39 40 |
# File 'lib/simply_stored/couch/validations.rb', line 38 def i18n super || "#{i18n_prefix}.invalid" end |
#message(instance) ⇒ Object
34 35 36 |
# File 'lib/simply_stored/couch/validations.rb', line 34 def (instance) super || "is invalid" end |
#valid?(instance) ⇒ Boolean
29 30 31 32 |
# File 'lib/simply_stored/couch/validations.rb', line 29 def valid?(instance) (allow_blank && instance.send(attribute).blank?) || !(instance.send(self.attribute).to_s =~ self.with).nil? end |