Class: MailCatcher::API::Mailbox::Message
- Inherits:
-
Object
- Object
- MailCatcher::API::Mailbox::Message
- Extended by:
- Forwardable
- Defined in:
- lib/mailcatcher/api/mailbox/message.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #delete! ⇒ Object
-
#initialize(msg) ⇒ Message
constructor
A new instance of Message.
- #links ⇒ Object
Constructor Details
#initialize(msg) ⇒ Message
Returns a new instance of Message.
16 17 18 19 20 21 |
# File 'lib/mailcatcher/api/mailbox/message.rb', line 16 def initialize(msg) @id = msg['id'].to_i @raw = msg['source'] @mail = Mail.new(@raw) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
14 15 16 |
# File 'lib/mailcatcher/api/mailbox/message.rb', line 14 def id @id end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
14 15 16 |
# File 'lib/mailcatcher/api/mailbox/message.rb', line 14 def raw @raw end |
Instance Method Details
#delete! ⇒ Object
27 28 29 |
# File 'lib/mailcatcher/api/mailbox/message.rb', line 27 def delete! MailCatcher::API::Client.(id) end |
#links ⇒ Object
23 24 25 |
# File 'lib/mailcatcher/api/mailbox/message.rb', line 23 def links @links ||= URI.extract(decode_body).select { |s| s.start_with?('http') || s.start_with?('https') } end |