class Bunq::AttachmentPublics
Public Class Methods
new(client)
click to toggle source
# File lib/bunq/attachment_publics.rb, line 7 def initialize(client) @resource = Bunq::Resource.new(client, '/v1/attachment-public') end
Public Instance Methods
create(binary_payload, description, mime_type)
click to toggle source
# File lib/bunq/attachment_publics.rb, line 11 def create(binary_payload, description, mime_type) custom_headers = { Bunq::Header::CONTENT_TYPE => mime_type, Bunq::Header::ATTACHMENT_DESCRIPTION => description, } payload = Base64.decode64(binary_payload) @resource.with_session { @resource.post(payload, custom_headers: custom_headers) }['Response'] end