Class: MailCatcher::API::Message
- Inherits:
-
Object
- Object
- MailCatcher::API::Message
- Defined in:
- lib/mailcatcher/api/message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#charset ⇒ Object
readonly
Returns the value of attribute charset.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(raw_message) ⇒ Message
constructor
A new instance of Message.
- #links ⇒ Object
Constructor Details
#initialize(raw_message) ⇒ Message
Returns a new instance of Message.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mailcatcher/api/message.rb', line 12 def initialize() mail = Mail.new() @raw = = mail. @date = mail.date @from = mail.from @to = mail.to @subject = mail.subject @body = mail.body.raw_source @mime_type = mail.mime_type @charset = mail.charset @content_type = mail.content_type end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/mailcatcher/api/message.rb', line 9 def body @body end |
#charset ⇒ Object (readonly)
Returns the value of attribute charset.
10 11 12 |
# File 'lib/mailcatcher/api/message.rb', line 10 def charset @charset end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
10 11 12 |
# File 'lib/mailcatcher/api/message.rb', line 10 def content_type @content_type end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
8 9 10 |
# File 'lib/mailcatcher/api/message.rb', line 8 def date @date end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
9 10 11 |
# File 'lib/mailcatcher/api/message.rb', line 9 def from @from end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id.
8 9 10 |
# File 'lib/mailcatcher/api/message.rb', line 8 def end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
10 11 12 |
# File 'lib/mailcatcher/api/message.rb', line 10 def mime_type @mime_type end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
7 8 9 |
# File 'lib/mailcatcher/api/message.rb', line 7 def raw @raw end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
9 10 11 |
# File 'lib/mailcatcher/api/message.rb', line 9 def subject @subject end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
9 10 11 |
# File 'lib/mailcatcher/api/message.rb', line 9 def to @to end |
Instance Method Details
#links ⇒ Object
27 28 29 |
# File 'lib/mailcatcher/api/message.rb', line 27 def links @links ||= URI.extract(@body).select { |s| s.start_with? 'http' } end |