Module: EmailFormat
- Defined in:
- lib/email_format.rb,
lib/email_format/version.rb
Constant Summary collapse
- VERSION =
'1.0.0'
Class Method Summary collapse
Class Method Details
.valid?(email, strict) ⇒ Boolean
6 7 8 9 10 11 12 |
# File 'lib/email_format.rb', line 6 def self.valid?(email, strict) if strict !!(email =~ EmailRegex::EMAIL_ADDRESS_REGEX) else !!(email =~ /^[\S&&[^@]]+@[\S&&[^@]]+$/) end end |