Class: Kenexa::JobParser

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

Constant Summary collapse

QUESTION_MAP =
{
  :title        => 7996,
  :city         => 15615,
  :state        => 15616,
  :internal_id  => 7972,
}.freeze

Instance Method Summary collapse

Instance Method Details

#parse(envelope) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/kenexa/job_parser.rb', line 12

def parse(envelope)
  envelope.search("//Job").map { |node|
    attributes = {
      :url          => extract_text(node, ".//JobDetailLink"),
      :last_updated => extract_date(node, ".//LastUpdated"),
    }

    QUESTION_MAP.keys.each do |attribute|
      attributes[attribute] = extract_question(node, attribute)
    end

    Job.new(attributes)
  }
end