Class: MailFetcher::MailCatcherMessage

Inherits:
EmailMessage show all
Defined in:
lib/mail_fetcher/mail_catcher_message.rb

Constant Summary

Constants inherited from EmailMessage

EmailMessage::URL_PATTERN

Instance Method Summary collapse

Methods inherited from EmailMessage

#initialize

Constructor Details

This class inherits a constructor from MailFetcher::EmailMessage

Instance Method Details

#html_bodyObject



13
14
15
# File 'lib/mail_fetcher/mail_catcher_message.rb', line 13

def html_body
  body(:html)
end

#html_urlsObject



17
18
19
# File 'lib/mail_fetcher/mail_catcher_message.rb', line 17

def html_urls
  html_body.scan(%r{href="(#{URL_PATTERN.source})"}).flatten
end

#plain_text_bodyObject



5
6
7
# File 'lib/mail_fetcher/mail_catcher_message.rb', line 5

def plain_text_body
  body(:plain)
end

#plain_text_urlsObject



9
10
11
# File 'lib/mail_fetcher/mail_catcher_message.rb', line 9

def plain_text_urls
  plain_text_body.match(URL_PATTERN).to_a
end