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



25
26
27
# File 'lib/mail_dude/attachment_locator.rb', line 25

def id
  @id
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



25
26
27
# File 'lib/mail_dude/attachment_locator.rb', line 25

def 
  @metadata
end

#partObject

Returns the value of attribute part

Returns:

  • (Object)

    the current value of part



25
26
27
# File 'lib/mail_dude/attachment_locator.rb', line 25

def part
  @part
end

Instance Method Details

#content_typeObject



26
27
28
# File 'lib/mail_dude/attachment_locator.rb', line 26

def content_type
  ['content_type']
end

#dataObject



30
31
32
33
34
# File 'lib/mail_dude/attachment_locator.rb', line 30

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

#filenameObject



36
37
38
# File 'lib/mail_dude/attachment_locator.rb', line 36

def filename
  ['filename']
end

#inline?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/mail_dude/attachment_locator.rb', line 40

def inline?
  ['inline']
end