Class: Greenhouse
- Inherits:
-
Object
- Object
- Greenhouse
- Defined in:
- lib/nexmo_developer/app/services/greenhouse.rb
Constant Summary collapse
- DEPARTMENT_ID =
4019731002
- TITLES =
['sdk', 'advocate', 'community manager', 'education', 'dashboard', 'documentation'].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #devrel_positions ⇒ Object
- #fetch_jobs ⇒ Object
-
#initialize ⇒ Greenhouse
constructor
A new instance of Greenhouse.
- #jobs ⇒ Object
- #offices ⇒ Object
Constructor Details
#initialize ⇒ Greenhouse
Returns a new instance of Greenhouse.
22 23 24 |
# File 'lib/nexmo_developer/app/services/greenhouse.rb', line 22 def initialize @client = GreenhouseIo::JobBoard.new end |
Class Method Details
.careers ⇒ Object
9 10 11 |
# File 'lib/nexmo_developer/app/services/greenhouse.rb', line 9 def self.careers new.jobs end |
.devrel_careers ⇒ Object
5 6 7 |
# File 'lib/nexmo_developer/app/services/greenhouse.rb', line 5 def self.devrel_careers new.devrel_positions end |
.expire_cache ⇒ Object
17 18 19 20 |
# File 'lib/nexmo_developer/app/services/greenhouse.rb', line 17 def self.expire_cache Rails.cache.delete('careers') Rails.cache.delete('offices') end |
.offices ⇒ Object
13 14 15 |
# File 'lib/nexmo_developer/app/services/greenhouse.rb', line 13 def self.offices new.offices end |
Instance Method Details
#devrel_positions ⇒ Object
26 27 28 |
# File 'lib/nexmo_developer/app/services/greenhouse.rb', line 26 def devrel_positions @devrel_positions ||= jobs.select(&:devrel?) end |
#fetch_jobs ⇒ Object
42 43 44 |
# File 'lib/nexmo_developer/app/services/greenhouse.rb', line 42 def fetch_jobs @client.jobs(content: 'true')[:jobs] end |
#jobs ⇒ Object
30 31 32 33 34 |
# File 'lib/nexmo_developer/app/services/greenhouse.rb', line 30 def jobs @jobs ||= Rails.cache.fetch('careers', expires_in: 1.hour) do fetch_jobs.map { |j| Career.new(j) } end end |
#offices ⇒ Object
36 37 38 39 40 |
# File 'lib/nexmo_developer/app/services/greenhouse.rb', line 36 def offices @offices ||= Rails.cache.fetch('offices', expires_in: 5.hours) do @client.offices[:offices] end end |