Class: Koho::Client::Contracts

Inherits:
Koho::Client show all
Defined in:
lib/koho.rb

Constant Summary

Constants inherited from Koho::Client

API_BASE_URL

Instance Attribute Summary

Attributes inherited from Koho::Client

#company_id, #token

Instance Method Summary collapse

Methods inherited from Koho::Client

#contracts, #customers, #delete, #get, #inbound_invoices, #info, #initialize, #invoice_terms, #invoices, #post, #project_tasks, #projects, #put, #work_sessions

Constructor Details

This class inherits a constructor from Koho::Client

Instance Method Details

#create(params) ⇒ Object



287
288
289
# File 'lib/koho.rb', line 287

def create params
  post '/', contract: params
end

#destroy(id) ⇒ Object



295
296
297
# File 'lib/koho.rb', line 295

def destroy id
  delete "/#{id}"
end

#find(id) ⇒ Object



276
277
278
# File 'lib/koho.rb', line 276

def find id
  get "/#{id}"
end

#find_by_customer(customer_id) ⇒ Object



280
281
282
# File 'lib/koho.rb', line 280

def find_by_customer customer_id
  get "/find_by_customer/#{customer_id}"
end

#invoice_checkObject



269
270
271
272
273
274
# File 'lib/koho.rb', line 269

def invoice_check
  status = nil
  Thread.new{status = post '/invoice_check'}
  sleep 5
  return status || {status: :ok, message: 'Request sent'}
end

#listObject



265
266
267
# File 'lib/koho.rb', line 265

def list
  get '/'
end

#update(id, params) ⇒ Object



291
292
293
# File 'lib/koho.rb', line 291

def update id, params
  put "/#{id}", contract: params
end