mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
parent
968a59cd3d
commit
a5c0333a5d
2 changed files with 17 additions and 1 deletions
15
lib/validators/email_validator.rb
Normal file
15
lib/validators/email_validator.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue