class Howitzer::MailAdapters::Abstract

Abstract is the superclass of all mail adapters.

@abstract This class should not be used directly. Instead, create a

subclass that implements:
{.find}
{#plain_text_body}
{#html_body}
{#text}
{#mail_from}
{#recipients}
{#received_time}
{#sender_email}
{#mime_part}

Attributes

message[R]

Public Class Methods

find(_recipient, _subject, _wait:) click to toggle source

Finds an email in mailbox @param _recipient [String] an email @param _subject [String] @param _wait [Integer] how much time is required to wait an email

# File lib/howitzer/mail_adapters/abstract.rb, line 24
def self.find(_recipient, _subject, _wait:)
  raise NotImplementedError
end
new(message) click to toggle source

@param message [Object] original message data

# File lib/howitzer/mail_adapters/abstract.rb, line 32
def initialize(message)
  @message = message
end

Public Instance Methods

html_body() click to toggle source

Returns a html body of the email message

# File lib/howitzer/mail_adapters/abstract.rb, line 44
def html_body
  raise NotImplementedError
end
mail_from() click to toggle source

Returns who has sent email data in format: User Name <user@email>

# File lib/howitzer/mail_adapters/abstract.rb, line 56
def mail_from
  raise NotImplementedError
end
mime_part() click to toggle source

Allows to get email MIME attachment

# File lib/howitzer/mail_adapters/abstract.rb, line 80
def mime_part
  raise NotImplementedError
end
plain_text_body() click to toggle source

Returns a plain text body of the email message

# File lib/howitzer/mail_adapters/abstract.rb, line 38
def plain_text_body
  raise NotImplementedError
end
received_time() click to toggle source

Returns email received time

# File lib/howitzer/mail_adapters/abstract.rb, line 68
def received_time
  raise NotImplementedError
end
recipients() click to toggle source

Returns an array of recipients who has received current email

# File lib/howitzer/mail_adapters/abstract.rb, line 62
def recipients
  raise NotImplementedError
end
sender_email() click to toggle source

Returns sender user email

# File lib/howitzer/mail_adapters/abstract.rb, line 74
def sender_email
  raise NotImplementedError
end
text() click to toggle source

Returns a mail text

# File lib/howitzer/mail_adapters/abstract.rb, line 50
def text
  raise NotImplementedError
end