Class: Validations::Validation
- Inherits:
-
Object
- Object
- Validations::Validation
- Defined in:
- lib/dew/validations.rb
Class Method Summary collapse
Class Method Details
.validates_format_of(string, regex) ⇒ Object
4 5 6 |
# File 'lib/dew/validations.rb', line 4 def self.validates_format_of string, regex raise ArgumentError, "Validation error. '#{string}' does not match '#{regex.inspect}'" unless regex.match(string) end |