Class: Mailflow::Attachment

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Attachment

Returns a new instance of Attachment.



7
8
9
10
11
12
13
# File 'lib/mailflow/attachment.rb', line 7

def initialize(attributes)
  @filename = attributes['filename']
  @content_type = attributes['content_type']
  @size = attributes['size']
  @hash = attributes['hash']
  @data = Base64.decode64(attributes['data'])
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



5
6
7
# File 'lib/mailflow/attachment.rb', line 5

def content_type
  @content_type
end

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/mailflow/attachment.rb', line 5

def data
  @data
end

#filenameObject (readonly)

Returns the value of attribute filename.



5
6
7
# File 'lib/mailflow/attachment.rb', line 5

def filename
  @filename
end

#hashObject (readonly)

Returns the value of attribute hash.



5
6
7
# File 'lib/mailflow/attachment.rb', line 5

def hash
  @hash
end

#sizeObject (readonly)

Returns the value of attribute size.



5
6
7
# File 'lib/mailflow/attachment.rb', line 5

def size
  @size
end