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



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

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

#destroy(id) ⇒ Object



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

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

#find(id) ⇒ Object



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

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

#find_by_customer(customer_id) ⇒ Object



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

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

#invoice_checkObject



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

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

#listObject



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

def list
  get '/'
end

#update(id, params) ⇒ Object



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

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