Module: DataMapper::Validations::ValidatesFormat
- Extended by:
- Deprecate
- Included in:
- ClassMethods
- Defined in:
- lib/dm-validations/validators/format_validator.rb
Overview
class FormatValidator
Instance Method Summary collapse
-
#validates_format_of(*fields) ⇒ Object
Validates that the attribute is in the specified format.
Instance Method Details
#validates_format_of(*fields) ⇒ Object
Validates that the attribute is in the specified format. You may use the :as (or :with, it’s an alias) option to specify the pre-defined format that you want to validate against. You may also specify your own format via a Proc or Regexp passed to the the :as or :with options.
117 118 119 |
# File 'lib/dm-validations/validators/format_validator.rb', line 117 def validates_format_of(*fields) validators.add(FormatValidator, *fields) end |