Sha256: a2c419ec587830c3b413ec86b99a04fb27ec37e880440643e1e4e36ffb80ad2f

Contents?: true

Size: 511 Bytes

Versions: 5

Compression:

Stored size: 511 Bytes

Contents

module SlimpayClient
  # An abstract Creditor to be inherited from.
  #
  # Defines API Creditor non-semantic methods.
  class Creditor < Resource
    def initialize
      @resource_name = self.class.to_s.demodulize.underscore.dasherize.pluralize
      super
    end

    def get_one(reference = 1)
      url = "#{@endpoint}/creditors/#{reference}"
      response = HTTParty.get(url, headers: options)
      generate_api_methods(JSON.parse(response.body))
      SlimpayClient.answer(response)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slimpay_client-1.0.0 lib/slimpay_client/creditor.rb
slimpay_client-0.1.3 lib/slimpay_client/creditor.rb
slimpay_client-0.1.2 lib/slimpay_client/creditor.rb
slimpay_client-0.1.1 lib/slimpay_client/creditor.rb
slimpay_client-0.1.0 lib/slimpay_client/creditor.rb