Module: Gadgeto::Email::Validators

Included in:
Gadgeto::Email
Defined in:
lib/gadgeto/email/validators.rb

Instance Method Summary collapse

Instance Method Details

#email?(email) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/gadgeto/email/validators.rb', line 4

def email?(email)
  !!(email =~ /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i)
end