Class: FreeAgent::BankTransactionExplanationsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/free_agent/resources/bank_transaction_explanations.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 FreeAgent::Resource

Instance Method Details

#delete(id:) ⇒ Object

Commented out as it needs more work def create(**params)

raise "bank_account or bank_transaction is required" unless !params[:bank_account].nil? || !params[:bank_transaction].nil?
response = post_request("bank_transaction_explanations", body: params)
response.body

end



23
24
25
26
# File 'lib/free_agent/resources/bank_transaction_explanations.rb', line 23

def delete(id:)
  response = delete_request("bank_transaction_explanations/#{id}")
  response.success?
end

#list(bank_account:, **params) ⇒ Object



4
5
6
7
8
9
# File 'lib/free_agent/resources/bank_transaction_explanations.rb', line 4

def list(bank_account:, **params)
  attributes = {bank_account: }

  response = get_request("bank_transaction_explanations", params: attributes.merge(params))
  Collection.from_response(response, type: BankTransactionExplanation, key: "bank_transaction_explanations")
end

#retrieve(id:) ⇒ Object



11
12
13
14
# File 'lib/free_agent/resources/bank_transaction_explanations.rb', line 11

def retrieve(id:)
  response = get_request("bank_transaction_explanations/#{id}")
  BankTransactionExplanation.new(response.body["bank_transaction_explanation"])
end