module WOTC::Client::Employees

Defines methods related to employees.

Public Instance Methods

certified_employees(company_id=nil) click to toggle source

Get employees with certified WOTC status

# File lib/wotc/client/employees.rb, line 48
def certified_employees(company_id=nil)
  if company_id.nil?
    get("employees/wotc/certified")
  else
    get("employees/wotc/certified?company_id=#{company_id}")
  end
end
create_employee(options={}) click to toggle source

Create an employee

# File lib/wotc/client/employees.rb, line 21
def create_employee(options={})
  post("employees", options)
end
employee(employee_id) click to toggle source

Get a single employee

# File lib/wotc/client/employees.rb, line 11
def employee(employee_id)
  get("employees/#{employee_id}")
end
employee_auto_fill_wotc_url(employee_id, redirect=nil) click to toggle source

Generate an auto fill WOTC url

# File lib/wotc/client/employees.rb, line 36
def employee_auto_fill_wotc_url(employee_id, redirect=nil)
  uri = URI.parse(redirect) rescue false
  result = if uri.kind_of?(URI::HTTP) || uri.kind_of?(URI::HTTPS)
    get("employees/#{employee_id}/wotc/url?redirect=#{redirect}")
  else
    get("employees/#{employee_id}/wotc/url")
  end

  return result.body["url"]
end
employee_wotc_info(employee_id) click to toggle source

Get wotc info for specific employee

# File lib/wotc/client/employees.rb, line 31
def employee_wotc_info(employee_id)
  get("employees/#{employee_id}/wotc")
end
employee_wotc_status(employee_id) click to toggle source

Get employee's WOTC status

# File lib/wotc/client/employees.rb, line 26
def employee_wotc_status(employee_id)
  get("employees#{employee_id}/wotc/status")
end
employees(options={}) click to toggle source

Fetch all employees

# File lib/wotc/client/employees.rb, line 6
def employees(options={})
  paginate("employees", options)
end
update_employee(employee_id, options={}) click to toggle source

Update an employee

# File lib/wotc/client/employees.rb, line 16
def update_employee(employee_id, options={})
  put("employees/#{employee_id}", options)
end