Class: SignalApi::EmailAddress
- Inherits:
-
Object
- Object
- SignalApi::EmailAddress
- Defined in:
- lib/signal_api/util/email_address.rb
Class Method Summary collapse
-
.valid?(email) ⇒ Boolean
Check to see if an email address is valid.
Class Method Details
.valid?(email) ⇒ Boolean
Check to see if an email address is valid
5 6 7 |
# File 'lib/signal_api/util/email_address.rb', line 5 def self.valid?(email) email && !email.strip.empty? && email.strip =~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i end |