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



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

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

#get_company_location(company_id, location_id, params = {}) ⇒ Object



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

def get_company_location(company_id, location_id, params = {})
  get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}/#{LOCATIONS_PATH}/#{location_id}", params)
end

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



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

def get_company_locations(company_id, params = {})
  get("#{API_PATH}#{COMPANIES_PATH}/#{company_id}/#{LOCATIONS_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



42
43
44
# File 'lib/paychex_api/client/companies.rb', line 42

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



38
39
40
# File 'lib/paychex_api/client/companies.rb', line 38

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