Class: EasyIMAP::Attachment
- Inherits:
-
Object
- Object
- EasyIMAP::Attachment
- Defined in:
- lib/easy_imap/attachment.rb
Instance Method Summary collapse
-
#body ⇒ Object
The body of this attachment.
-
#content_type ⇒ Object
The mime type of this attachment.
- #filename ⇒ Object
-
#initialize(body) ⇒ Attachment
constructor
A new instance of Attachment.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(body) ⇒ Attachment
Returns a new instance of Attachment.
3 4 5 |
# File 'lib/easy_imap/attachment.rb', line 3 def initialize(body) @body = body end |
Instance Method Details
#body ⇒ Object
The body of this attachment.
17 18 19 |
# File 'lib/easy_imap/attachment.rb', line 17 def body @body.body end |
#content_type ⇒ Object
The mime type of this attachment.
8 9 10 |
# File 'lib/easy_imap/attachment.rb', line 8 def content_type @body.content_type end |
#filename ⇒ Object
12 13 14 |
# File 'lib/easy_imap/attachment.rb', line 12 def filename @body.disposition_param("filename") end |
#to_s ⇒ Object Also known as: inspect
21 22 23 |
# File 'lib/easy_imap/attachment.rb', line 21 def to_s "<#{self.class}: @content_type='#{content_type}'>" end |