Add email validator

#186
This commit is contained in:
Artur Beljajev 2016-11-23 18:09:55 +02:00
parent 968a59cd3d
commit a5c0333a5d
2 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,15 @@
class EmailValidator
def self.regexp
Devise::email_regexp
end
def initialize(email)
@email = email
end
def valid?
email =~ self.class.regexp
end
attr_reader :email
end