Class: GreenhouseIo::Client

Inherits:
Object
  • Object
show all
Includes:
API, HTTMultiParty
Defined in:
lib/greenhouse_io/api/client.rb

Constant Summary collapse

PERMITTED_OPTIONS =
[:page, :per_page]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from API

#basic_auth, #get_response, #parse_json, #post_response

Constructor Details

#initialize(api_token = nil) ⇒ Client

Returns a new instance of Client.



11
12
13
# File 'lib/greenhouse_io/api/client.rb', line 11

def initialize(api_token = nil)
  @api_token = api_token || GreenhouseIo.configuration.api_token
end

Instance Attribute Details

#api_tokenObject

Returns the value of attribute api_token.



8
9
10
# File 'lib/greenhouse_io/api/client.rb', line 8

def api_token
  @api_token
end

#rate_limitObject

Returns the value of attribute rate_limit.



8
9
10
# File 'lib/greenhouse_io/api/client.rb', line 8

def rate_limit
  @rate_limit
end

#rate_limit_remainingObject

Returns the value of attribute rate_limit_remaining.



8
9
10
# File 'lib/greenhouse_io/api/client.rb', line 8

def rate_limit_remaining
  @rate_limit_remaining
end

Instance Method Details

#activity_feed(id, options = {}) ⇒ Object



27
28
29
# File 'lib/greenhouse_io/api/client.rb', line 27

def activity_feed(id, options = {})
  get_from_harvest_api "/candidates/#{id}/activity_feed", options
end

#applications(id = nil, options = {}) ⇒ Object



31
32
33
# File 'lib/greenhouse_io/api/client.rb', line 31

def applications(id = nil, options = {})
  get_from_harvest_api "/applications#{path_id(id)}", options
end

#candidates(id = nil, options = {}) ⇒ Object



23
24
25
# File 'lib/greenhouse_io/api/client.rb', line 23

def candidates(id = nil, options = {})
  get_from_harvest_api "/candidates#{path_id(id)}", options
end

#departments(id = nil, options = {}) ⇒ Object



19
20
21
# File 'lib/greenhouse_io/api/client.rb', line 19

def departments(id = nil, options = {})
  get_from_harvest_api "/departments#{path_id(id)}", options
end

#job_post(id, options = {}) ⇒ Object



51
52
53
# File 'lib/greenhouse_io/api/client.rb', line 51

def job_post(id, options = {})
  get_from_harvest_api "/jobs/#{id}/job_post", options
end

#jobs(id = nil, options = {}) ⇒ Object



43
44
45
# File 'lib/greenhouse_io/api/client.rb', line 43

def jobs(id = nil, options = {})
  get_from_harvest_api "/jobs#{path_id(id)}", options
end

#offices(id = nil, options = {}) ⇒ Object



15
16
17
# File 'lib/greenhouse_io/api/client.rb', line 15

def offices(id = nil, options = {})
  get_from_harvest_api "/offices#{path_id(id)}", options
end

#scheduled_interviews(id, options = {}) ⇒ Object



39
40
41
# File 'lib/greenhouse_io/api/client.rb', line 39

def scheduled_interviews(id, options = {})
  get_from_harvest_api "/applications/#{id}/scheduled_interviews", options
end

#scorecards(id, options = {}) ⇒ Object



35
36
37
# File 'lib/greenhouse_io/api/client.rb', line 35

def scorecards(id, options = {})
  get_from_harvest_api "/applications/#{id}/scorecards", options
end

#sources(id = nil, options = {}) ⇒ Object



59
60
61
# File 'lib/greenhouse_io/api/client.rb', line 59

def sources(id = nil, options = {})
  get_from_harvest_api "/sources#{path_id(id)}", options
end

#stages(id, options = {}) ⇒ Object



47
48
49
# File 'lib/greenhouse_io/api/client.rb', line 47

def stages(id, options = {})
  get_from_harvest_api "/jobs/#{id}/stages", options
end

#users(id = nil, options = {}) ⇒ Object



55
56
57
# File 'lib/greenhouse_io/api/client.rb', line 55

def users(id = nil, options = {})
  get_from_harvest_api "/users#{path_id(id)}", options
end