Class: Rosebud::Validations::RegexValidator

Inherits:
Rosebud::Validator show all
Defined in:
lib/rosebud/validations/regex_validator.rb

Instance Method Summary collapse

Methods inherited from Rosebud::Validator

#validate!

Instance Method Details

#validate_param(name, value, pattern) ⇒ Object



4
5
6
# File 'lib/rosebud/validations/regex_validator.rb', line 4

def validate_param(name, value, pattern)
  error!(:regex, param: name) if value && (value.to_s =~ pattern).nil?
end