Class: Truemail::Validate::Regex

Inherits:
Base show all
Defined in:
lib/truemail/validate/regex.rb

Constant Summary collapse

ERROR =
'email does not match the regular expression'

Instance Attribute Summary

Attributes inherited from Worker

#result

Instance Method Summary collapse

Methods inherited from Worker

check, #initialize

Constructor Details

This class inherits a constructor from Truemail::Worker

Instance Method Details

#runObject


8
9
10
11
12
# File 'lib/truemail/validate/regex.rb', line 8

def run
  return true if success(match_regex_pattern?)
  add_error(Truemail::Validate::Regex::ERROR)
  false
end