Class: JazzHR::Job
- Inherits:
-
Object
- Object
- JazzHR::Job
- Defined in:
- lib/jazz_hr/job.rb
Instance Attribute Summary collapse
-
#board_code ⇒ Object
Returns the value of attribute board_code.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country_id ⇒ Object
Returns the value of attribute country_id.
-
#department ⇒ Object
Returns the value of attribute department.
-
#description ⇒ Object
Returns the value of attribute description.
-
#hiring_lead ⇒ Object
Returns the value of attribute hiring_lead.
-
#id ⇒ Object
Returns the value of attribute id.
-
#internal_code ⇒ Object
Returns the value of attribute internal_code.
-
#job_applicants ⇒ Object
Returns the value of attribute job_applicants.
-
#maximum_salary ⇒ Object
Returns the value of attribute maximum_salary.
-
#minimum_salary ⇒ Object
Returns the value of attribute minimum_salary.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#original_open_date ⇒ Object
Returns the value of attribute original_open_date.
-
#questionnaire ⇒ Object
Returns the value of attribute questionnaire.
-
#send_to_job_boards ⇒ Object
Returns the value of attribute send_to_job_boards.
-
#state ⇒ Object
Returns the value of attribute state.
-
#status ⇒ Object
Returns the value of attribute status.
-
#team_id ⇒ Object
Returns the value of attribute team_id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#zip ⇒ Object
Returns the value of attribute zip.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Job
constructor
A new instance of Job.
Constructor Details
#initialize(attributes) ⇒ Job
Returns a new instance of Job.
29 30 31 32 33 |
# File 'lib/jazz_hr/job.rb', line 29 def initialize(attributes) attributes.each do |attribute, value| self.send("#{attribute}=", value) end end |
Instance Attribute Details
#board_code ⇒ Object
Returns the value of attribute board_code.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def board_code @board_code end |
#city ⇒ Object
Returns the value of attribute city.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def city @city end |
#country_id ⇒ Object
Returns the value of attribute country_id.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def country_id @country_id end |
#department ⇒ Object
Returns the value of attribute department.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def department @department end |
#description ⇒ Object
Returns the value of attribute description.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def description @description end |
#hiring_lead ⇒ Object
Returns the value of attribute hiring_lead.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def hiring_lead @hiring_lead end |
#id ⇒ Object
Returns the value of attribute id.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def id @id end |
#internal_code ⇒ Object
Returns the value of attribute internal_code.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def internal_code @internal_code end |
#job_applicants ⇒ Object
Returns the value of attribute job_applicants.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def job_applicants @job_applicants end |
#maximum_salary ⇒ Object
Returns the value of attribute maximum_salary.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def maximum_salary @maximum_salary end |
#minimum_salary ⇒ Object
Returns the value of attribute minimum_salary.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def minimum_salary @minimum_salary end |
#notes ⇒ Object
Returns the value of attribute notes.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def notes @notes end |
#original_open_date ⇒ Object
Returns the value of attribute original_open_date.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def original_open_date @original_open_date end |
#questionnaire ⇒ Object
Returns the value of attribute questionnaire.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def questionnaire @questionnaire end |
#send_to_job_boards ⇒ Object
Returns the value of attribute send_to_job_boards.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def send_to_job_boards @send_to_job_boards end |
#state ⇒ Object
Returns the value of attribute state.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def state @state end |
#status ⇒ Object
Returns the value of attribute status.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def status @status end |
#team_id ⇒ Object
Returns the value of attribute team_id.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def team_id @team_id end |
#title ⇒ Object
Returns the value of attribute title.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def type @type end |
#zip ⇒ Object
Returns the value of attribute zip.
23 24 25 |
# File 'lib/jazz_hr/job.rb', line 23 def zip @zip end |
Class Method Details
.find(client:, id:) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/jazz_hr/job.rb', line 14 def self.find(client:, id:) raise Error.new("No job ID supplied") if id.nil? job_attributes = client.get(path: "/jobs/#{id}") return nil if job_attributes["id"] != id new(job_attributes) end |
.search(client:) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/jazz_hr/job.rb', line 3 def self.search(client:) response = client.get(path: "/jobs") if response.is_a? Array response.map do |job_attributes| new(job_attributes) end else [new(response)] end end |