Class: BounceFetcher::EmailExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/bounce_fetcher/email_extractor.rb

Constant Summary collapse

EMAIL_REGEX =
/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i

Instance Method Summary collapse

Instance Method Details

#extract_emails(string) ⇒ Object



7
8
9
# File 'lib/bounce_fetcher/email_extractor.rb', line 7

def extract_emails(string)
  string.scan(EMAIL_REGEX).compact.uniq
end