Class: Osm::Email::DeliveryReport::Email

Inherits:
Model
  • Object
show all
Defined in:
lib/osm/email.rb

Constant Summary collapse

SORT_BY =
[:subject, :from, :to]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#<, #<=, #<=>, #>, #>=, #between?, #changed_attributes, configure, #reset_changed_attributes, #to_i

Constructor Details

#initializeObject

Initialize a new DeliveryReport::Email

Parameters:

  • attributes (Hash)

    The hash of attributes (see attributes for descriptions, use Symbol of attribute name as the key)



# File 'lib/osm/email.rb', line 350

Instance Attribute Details

#bodyString

Returns the body of the email.

Returns:

  • (String)

    the body of the email



335
# File 'lib/osm/email.rb', line 335

attribute :to, type: String

#fromString

Returns who the email was sent from.

Returns:

  • (String)

    who the email was sent from



335
# File 'lib/osm/email.rb', line 335

attribute :to, type: String

#subjectString

Returns the subject of the email.

Returns:

  • (String)

    the subject of the email



335
# File 'lib/osm/email.rb', line 335

attribute :to, type: String

#toString

Returns who the email was sent to (possibly nil).

Returns:

  • (String)

    who the email was sent to (possibly nil)



335
# File 'lib/osm/email.rb', line 335

attribute :to, type: String

Instance Method Details

#to_sObject



355
356
357
# File 'lib/osm/email.rb', line 355

def to_s
  "To: #{to}\nFrom: #{from}\n\n#{subject}\n\n#{body.gsub(/<\/?[^>]*>/, '')}"
end