Module: WOTC::Client::Companies

Included in:
WOTC::Client
Defined in:
lib/wotc/client/companies.rb

Overview

Defines methods related to companies

Instance Method Summary collapse

Instance Method Details

#current_companyObject

Get the info of company



25
26
27
28
# File 'lib/wotc/client/companies.rb', line 25

def current_company
  result = get('user').body
  result["company"] 
end

#get_company_settings(company_id = nil) ⇒ Object

Get company settings, if there are no settings saved, anempty response if given.



7
8
9
10
11
12
13
# File 'lib/wotc/client/companies.rb', line 7

def get_company_settings(company_id=nil)
  if company_id.nil?
    get("company/settings")
  else
    get("company/settings/?company_id=#{company_id}")
  end
end

#update_company_settings(company_id = nil, options = {}) ⇒ Object

Update company settings



16
17
18
19
20
21
22
# File 'lib/wotc/client/companies.rb', line 16

def update_company_settings(company_id=nil, options={})
  if company_id.nil?
    put("company/settings", options)
  else
    put("company/settings?company_id=#{company_id}", options)
  end
end