Class: EasyIMAP::Attachment

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_imap/attachment.rb

Instance Method Summary collapse

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

#bodyObject

The body of this attachment.



17
18
19
# File 'lib/easy_imap/attachment.rb', line 17

def body
  @body.body
end

#content_typeObject

The mime type of this attachment.



8
9
10
# File 'lib/easy_imap/attachment.rb', line 8

def content_type
  @body.content_type
end

#filenameObject



12
13
14
# File 'lib/easy_imap/attachment.rb', line 12

def filename
  @body.disposition_param("filename")
end

#to_sObject 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