Method: Paychex::Client::Workers#worker_status
- Defined in:
- lib/paychex/client/workers.rb
#worker_status(company_id, worker_id) ⇒ Object
Get company’s linked status
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/paychex/client/workers.rb', line 28 def worker_status(company_id, worker_id) begin content = workers(company_id).body.fetch('content') return 'valid' if content.one?{ |worker| worker.fetch('workerId') == worker_id } rescue Paychex::NoAccess => e return 'not-linked' rescue Paychex::NotFound => e return 'invalid' rescue StandardError => e p 'Paychex Gem: Handle more errors' p e end 'unsupported' end |