Module: PaychexAPI::Client::Companies

Defined in:
lib/paychex_api/client/companies.rb

Instance Method Summary collapse

Instance Method Details

#get_company(company_id, params = {}) ⇒ Object



4
5
6
7
# File 'lib/paychex_api/client/companies.rb', line 4

def get_company(company_id, params = {})
  connection.headers[:accept] = "application/json;profile='http://api.paychex.com/profiles/company_productconfigs/v1'"
  get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}", params)
end

#get_company_associations(company_id, params = {}) ⇒ Object



9
10
11
12
# File 'lib/paychex_api/client/companies.rb', line 9

def get_company_associations(company_id, params = {})
  connection.headers[:accept] = "application/json;profile='http://api.paychex.com/profiles/company_associations/v1'"
  get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}", params)
end

#get_company_associations_by_regex_type(company_id, regex, params = {}) ⇒ Object



14
15
16
17
18
# File 'lib/paychex_api/client/companies.rb', line 14

def get_company_associations_by_regex_type(company_id, regex, params = {})
  connection.headers[:accept] = "application/json;profile='http://api.paychex.com/profiles/company_associations/v1'"
  results = get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}", params)
  filter_associations(results, regex)
end

#get_company_by_display_id(display_id, params = {}) ⇒ Object



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

def get_company_by_display_id(display_id, params = {})
  params = params.merge(displayid: display_id)
  get("#{API_PATH}#{COMPANIES_PATH}", params)
end

#get_company_workers(company_id, params = {}) ⇒ Object



20
21
22
23
# File 'lib/paychex_api/client/companies.rb', line 20

def get_company_workers(company_id, params = {})
  connection.headers[:accept] = "application/json;profile='http://api.paychex.com/profiles/workers_users/nonpii/v1'"
  get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}#{WORKERS_PATH}", params)
end

#get_organization(company_id, organization_id, params = {}) ⇒ Object



34
35
36
# File 'lib/paychex_api/client/companies.rb', line 34

def get_organization(company_id, organization_id, params = {})
  get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}#{ORGANIZATIONS_PATH}/#{organization_id}", params)
end

#get_organizations(company_id, _organization_id, params = {}) ⇒ Object



30
31
32
# File 'lib/paychex_api/client/companies.rb', line 30

def get_organizations(company_id, _organization_id, params = {})
  get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}#{ORGANIZATIONS_PATH}", params)
end