Class: FindworkApi::JobsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/findwork_api/resources/jobs.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#default_headers, #get_request, #handle_response, #initialize

Constructor Details

This class inherits a constructor from FindworkApi::Resource

Instance Method Details

#find(id) ⇒ Object



18
19
20
# File 'lib/findwork_api/resources/jobs.rb', line 18

def find(id)
  Job.new get_request("jobs/#{id}", params: params)
end

#list(search: nil, source: nil, location: nil, remote: nil, employees: nil, employment_type: nil, order_by: nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/findwork_api/resources/jobs.rb', line 3

def list(search: nil, source: nil, location: nil, remote: nil, employees: nil, employment_type: nil, order_by: nil)
  # TODO: Add pagination (in Collection)
  Collection.from_response(get_request("jobs/",
                                        params: {
                                          search: search,
                                          source: source,
                                          location: location,
                                          remote: remote,
                                          company_num_employees: employees,
                                          employment_type: employment_type,
                                          order_by: order_by
                                        }.compact
                                      ), key: "results", type: Job)
end