class MailFetcher::MailCatcherMessage

Public Instance Methods

html_body() click to toggle source
# File lib/mail_fetcher/mail_catcher_message.rb, line 13
def html_body
  body(:html)
end
html_urls() click to toggle source
# 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_body() click to toggle source
# File lib/mail_fetcher/mail_catcher_message.rb, line 5
def plain_text_body
  body(:plain)
end
plain_text_urls() click to toggle source
# File lib/mail_fetcher/mail_catcher_message.rb, line 9
def plain_text_urls
  plain_text_body.match(URL_PATTERN).to_a
end

Private Instance Methods

body(format=:json) click to toggle source

@param format - :html, :plain, :json

# File lib/mail_fetcher/mail_catcher_message.rb, line 24
def body(format=:json)
  @connection.get("/messages/#{@message_id}.#{format}").body
end