Class: MailDude::AttachmentLocator::Attachment

Inherits:
Struct
  • Object
show all
Defined in:
lib/mail_dude/attachment_locator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



5
6
7
# File 'lib/mail_dude/attachment_locator.rb', line 5

def id
  @id
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



5
6
7
# File 'lib/mail_dude/attachment_locator.rb', line 5

def 
  @metadata
end

#partObject

Returns the value of attribute part

Returns:

  • (Object)

    the current value of part



5
6
7
# File 'lib/mail_dude/attachment_locator.rb', line 5

def part
  @part
end

Instance Method Details

#content_typeObject



6
7
8
# File 'lib/mail_dude/attachment_locator.rb', line 6

def content_type
  ['content_type']
end

#dataObject



10
11
12
13
14
# File 'lib/mail_dude/attachment_locator.rb', line 10

def data
  part.decoded
rescue StandardError
  part.body.raw_source.to_s
end

#filenameObject



16
17
18
# File 'lib/mail_dude/attachment_locator.rb', line 16

def filename
  ['filename']
end

#inline?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/mail_dude/attachment_locator.rb', line 20

def inline?
  ['inline']
end