Class: Postal::Attachment

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Attachment

Returns a new instance of Attachment.


6
7
8
# File 'lib/postal/attachment.rb', line 6

def initialize(attributes)
  @attributes = attributes
end

Instance Method Details

#content_typeObject


14
15
16
# File 'lib/postal/attachment.rb', line 14

def content_type
  @attributes['content_type']
end

#dataObject


26
27
28
# File 'lib/postal/attachment.rb', line 26

def data
  @data ||= Base64.decode64(@attributes['data'])
end

#filenameObject


10
11
12
# File 'lib/postal/attachment.rb', line 10

def filename
  @attributes['filename']
end

#hashObject


22
23
24
# File 'lib/postal/attachment.rb', line 22

def hash
  @attributes['hash']
end

#sizeObject


18
19
20
# File 'lib/postal/attachment.rb', line 18

def size
  @attributes['size']
end