Class: SlimpayClient::Creditor
- Defined in:
- lib/slimpay_client/creditor.rb
Overview
An abstract Creditor to be inherited from.
Defines API Creditor non-semantic methods.
Instance Method Summary collapse
- #get_one(reference = 1) ⇒ Object
-
#initialize ⇒ Creditor
constructor
A new instance of Creditor.
Methods inherited from Base
Constructor Details
#initialize ⇒ Creditor
Returns a new instance of Creditor.
6 7 8 9 |
# File 'lib/slimpay_client/creditor.rb', line 6 def initialize @resource_name = self.class.to_s.demodulize.underscore.dasherize.pluralize super end |
Instance Method Details
#get_one(reference = 1) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/slimpay_client/creditor.rb', line 11 def get_one(reference = 1) url = "#{@endpoint}/creditors/#{reference}" response = HTTParty.get(url, headers: ) generate_api_methods(JSON.parse(response.body)) SlimpayClient.answer(response) end |