Class: ColumnApi::WireTransferResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/column_api/resources/wire_transfer_resource.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from ColumnApi::Resource

Instance Method Details

#create(params) ⇒ Object



14
15
16
# File 'lib/column_api/resources/wire_transfer_resource.rb', line 14

def create(params)
  WireTransfer.new post_request("transfers/wire", body: params).body
end

#list(params = {}) ⇒ Object



5
6
7
8
# File 'lib/column_api/resources/wire_transfer_resource.rb', line 5

def list(params = {})
  response = get_request("transfers/wire", params: params).body
  Collection.from_response(response, key: "transfers", type: WireTransfer)
end

#retrieve(wire_transfer_id:) ⇒ Object



10
11
12
# File 'lib/column_api/resources/wire_transfer_resource.rb', line 10

def retrieve(wire_transfer_id:)
  WireTransfer.new get_request("transfers/wire/#{wire_transfer_id}").body
end

#reverse(wire_transfer_id:, reason:, description: "") ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/column_api/resources/wire_transfer_resource.rb', line 18

def reverse(wire_transfer_id:, reason:, description: "")
  WireTransfer.new(
    post_request(
      "transfers/wire/#{wire_transfer_id}/reverse",
      body: { reason: reason, description: description }
    ).body
  )
end