Class: Kenexa::Job

Inherits:
Struct
  • Object
show all
Defined in:
lib/kenexa/job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Job



5
6
7
8
9
# File 'lib/kenexa/job.rb', line 5

def initialize(attributes = {})
  attributes.each do |attribute, value|
    send("#{attribute}=", value)
  end
end

Instance Attribute Details

#cityObject

Returns the value of attribute city



3
4
5
# File 'lib/kenexa/job.rb', line 3

def city
  @city
end

#internal_idObject

Returns the value of attribute internal_id



3
4
5
# File 'lib/kenexa/job.rb', line 3

def internal_id
  @internal_id
end

#last_updatedObject

Returns the value of attribute last_updated



3
4
5
# File 'lib/kenexa/job.rb', line 3

def last_updated
  @last_updated
end

#stateObject

Returns the value of attribute state



3
4
5
# File 'lib/kenexa/job.rb', line 3

def state
  @state
end

#titleObject

Returns the value of attribute title



3
4
5
# File 'lib/kenexa/job.rb', line 3

def title
  @title
end

#urlObject

Returns the value of attribute url



3
4
5
# File 'lib/kenexa/job.rb', line 3

def url
  @url
end

Instance Method Details

#descriptionObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/kenexa/job.rb', line 11

def description
  @description ||= begin
                     doc = Nokogiri::HTML(open(url))

                     parser = JobDetailParser.new
                     details = parser.parse(doc)

                     details['Job Description']
                   end
end