Upload files to 'lib/postman'

This commit is contained in:
nikkel 2020-03-20 02:24:48 +07:00
parent 51395d835a
commit ad74632897

31
lib/postman/attachment.rb Normal file
View File

@ -0,0 +1,31 @@
require 'base64'
module Postman
class Attachment
def initialize(attributes)
@attributes = attributes
end
def filename
@attributes['filename']
end
def content_type
@attributes['content_type']
end
def size
@attributes['size']
end
def hash
@attributes['hash']
end
def data
@data ||= Base64.decode64(@attributes['data'])
end
end
end