Class: Bunq::AttachmentPublics
- Inherits:
-
Object
- Object
- Bunq::AttachmentPublics
- Defined in:
- lib/bunq/attachment_publics.rb
Instance Method Summary collapse
- #create(binary_payload, description, mime_type) ⇒ Object
-
#initialize(client) ⇒ AttachmentPublics
constructor
A new instance of AttachmentPublics.
Constructor Details
#initialize(client) ⇒ AttachmentPublics
Returns a new instance of AttachmentPublics.
7 8 9 |
# File 'lib/bunq/attachment_publics.rb', line 7 def initialize(client) @resource = Bunq::Resource.new(client, '/v1/attachment-public') end |
Instance Method Details
#create(binary_payload, description, mime_type) ⇒ Object
11 12 13 14 15 16 17 18 |
# 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 |