module PaychexAPI::Client::Companies
Public Instance Methods
get_company(company_id, params = {})
click to toggle source
# 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 = {})
click to toggle source
# 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 = {})
click to toggle source
# 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 = {})
click to toggle source
# 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 = {})
click to toggle source
# 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 = {})
click to toggle source
# 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 = {})
click to toggle source
# 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
Private Instance Methods
filter_associations(results, regex)
click to toggle source
# File lib/paychex_api/client/companies.rb, line 40 def filter_associations(results, regex) results.members.map! do |member| if member['associations'].present? member['associations'] = member['associations'].select do |association| regex.match?(association['associationType']) end end member end results end