postman-ruby/lib/postman/attachment.rb
2020-03-20 02:24:48 +07:00

32 lines
425 B
Ruby

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