Module: Email
- Defined in:
- lib/email.rb
Constant Summary collapse
- VERSION =
"0.1.0"- ACADEMIC_TLDS =
%w(edu ac.uk)- ACADEMIC_DOMAINS =
%w(ugr.es uottawa.ca)
Class Method Summary collapse
Class Method Details
.academic?(email) ⇒ Boolean
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/email.rb', line 10 def academic?(email) domain = PublicSuffix.parse(email.split("@")[1]) if ACADEMIC_TLDS.include?(domain.tld) true elsif ACADEMIC_DOMAINS.include? (domain.domain) true else false end end |