Class: IcimsClient::IcimsJob

Inherits:
Object
  • Object
show all
Defined in:
lib/icims_client.rb

Overview

A job container with methods to retrieve attribute and custom field values.

Instance Method Summary collapse

Constructor Details

#initialize(job_record) ⇒ IcimsJob

customers a job from a job_record data structure generated from the SOAP response as serialized by xml-simple



99
100
101
# File 'lib/icims_client.rb', line 99

def initialize(job_record)
  @job_record = job_record
end

Instance Method Details

#get_attribute(key) ⇒ Object

Returns the value for the provided attribute key. nil if there is no such attribute.



106
107
108
109
110
111
112
113
114
# File 'lib/icims_client.rb', line 106

def get_attribute(key)

  #I wish ruby had a safe navigation operator
  begin
    return IcimsAttributeValue.new(@job_record[key][0])
  rescue
    return nil
  end
end

#get_custom_field(key) ⇒ Object

Returns the value for the provided custom field key. nil if there is no such attribute.



130
131
132
133
134
135
136
137
138
# File 'lib/icims_client.rb', line 130

def get_custom_field(key)

  #I wish ruby had a safe navigation operator
  begin
    return IcimsAttributeValue.new(@job_record['CustomField'][key]['content'])
  rescue
    return nil
  end
end

#get_industry_levelsObject

Returns the Industry levels as an IcimsAttributeArray



119
120
121
122
123
124
125
# File 'lib/icims_client.rb', line 119

def get_industry_levels
  begin
    return IcimsAttributeArray.new(@job_record['Industry'].first['Level'])
  rescue
    return IcimsAttributeArray.new()
  end
end