Class: Fakturoid::Client::Todo

Inherits:
Api
  • Object
show all
Defined in:
lib/fakturoid/client/todo.rb

Class Method Summary collapse

Methods inherited from Api

config, configure

Methods included from Api::Arguments

#permit_params, #validate_numerical_id, #validate_search_query

Methods included from Api::HttpMethods

#delete_request, #get_request, #patch_request, #post_request

Class Method Details

.all(params = {}) ⇒ Object



4
5
6
7
8
# File 'lib/fakturoid/client/todo.rb', line 4

def self.all(params = {})
  request_params = permit_params(params, :page, :since) || {}

  get_request('todos.json', request_params: request_params)
end

.toggle_completion(id) ⇒ Object



10
11
12
13
# File 'lib/fakturoid/client/todo.rb', line 10

def self.toggle_completion(id)
  validate_numerical_id(id)
  post_request("todos/#{id}/toggle_completion.json")
end