Class: PapierkramApi::V1::Endpoints::Income::PaymentTerms

Inherits:
Base
  • Object
show all
Defined in:
lib/papierkram_api/v1/endpoints/income/payment_terms.rb

Overview

This class is responsible for all the API calls related to income propositions.

Instance Attribute Summary

Attributes inherited from Base

#client, #url_api_path

Instance Method Summary collapse

Methods inherited from Base

#http_delete, #http_get, #http_patch, #http_post, #http_put, #initialize, #remaining_quota

Constructor Details

This class inherits a constructor from PapierkramApi::V1::Endpoints::Base

Instance Method Details

#all(page: 1, page_size: 100, order_by: nil, order_direction: nil) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/papierkram_api/v1/endpoints/income/payment_terms.rb', line 13

def all(page: 1,
        page_size: 100,
        order_by: nil,
        order_direction: nil)
  query = {
    page: page,
    page_size: page_size
  }
  query[:order_by] = order_by if order_by
  query[:order_direction] = order_direction if order_direction

  http_get("#{@url_api_path}/income/payment_terms", query)
end

#find_by(id:) ⇒ Object



9
10
11
# File 'lib/papierkram_api/v1/endpoints/income/payment_terms.rb', line 9

def find_by(id:)
  http_get("#{@url_api_path}/income/payment_terms/#{id}")
end