Class: Fakturoid::Api::Subject
- Inherits:
-
Object
- Object
- Fakturoid::Api::Subject
show all
- Includes:
- Base
- Defined in:
- lib/fakturoid/api/subject.rb
Instance Attribute Summary
Attributes included from Base
#client
Instance Method Summary
collapse
Methods included from Base
#initialize, #perform_request
Instance Method Details
#all(params = {}) ⇒ Object
8
9
10
11
12
|
# File 'lib/fakturoid/api/subject.rb', line 8
def all(params = {})
request_params = Utils.permit_params(params, :since, :updated_since, :page, :custom_id) || {}
perform_request(HTTP_GET, "subjects.json", request_params: request_params)
end
|
#create(payload = {}) ⇒ Object
27
28
29
|
# File 'lib/fakturoid/api/subject.rb', line 27
def create(payload = {})
perform_request(HTTP_POST, "subjects.json", payload: payload)
end
|
#search(params = {}) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/fakturoid/api/subject.rb', line 14
def search(params = {})
Utils.validate_search_query(query: params[:query])
request_params = Utils.permit_params(params, :query, :page)
perform_request(HTTP_GET, "subjects/search.json", request_params: request_params)
end
|
#update(id, payload = {}) ⇒ Object
31
32
33
34
|
# File 'lib/fakturoid/api/subject.rb', line 31
def update(id, payload = {})
Utils.validate_numerical_id(id)
perform_request(HTTP_PATCH, "subjects/#{id}.json", payload: payload)
end
|