zohoho 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/zohoho/connection.rb +1 -1
- data/lib/zohoho/recruit.rb +23 -3
- data/zohoho.gemspec +1 -1
- metadata +1 -1
data/lib/zohoho/connection.rb
CHANGED
@@ -22,7 +22,7 @@ module Zohoho
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def ticket
|
25
|
-
|
25
|
+
Regexp.last_match(1) if self.class.post(ticket_url).parsed_response =~ /TICKET=(\w+)/
|
26
26
|
end
|
27
27
|
|
28
28
|
def call(entry, api_method, query = {}, http_method = :get)
|
data/lib/zohoho/recruit.rb
CHANGED
@@ -19,8 +19,28 @@ module Zohoho
|
|
19
19
|
"http://recruit.zoho.com/ats/private/#{type}/Candidates/getRecords?apikey=#{@conn.api_key}&ticket=#{@conn.ticket}"
|
20
20
|
end
|
21
21
|
|
22
|
-
def get_candidates(conditions = {
|
23
|
-
|
24
|
-
end
|
22
|
+
def get_candidates(conditions = {})
|
23
|
+
(@type == 'json' ? JSON.parse(self.class.get(candidates_url, conditions)) : Nokogiri::XML.parse(self.class.get(candidates_url, conditions)))
|
24
|
+
end
|
25
|
+
|
26
|
+
def candidates(conditions = {})
|
27
|
+
@candidates ||= get_candidates
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_parsed_candidates(conditions = {:toIndex => 200})
|
31
|
+
raw_candidates = candidates
|
32
|
+
@candidates = raw_candidates["response"]["result"]["Candidates"]["row"]
|
33
|
+
|
34
|
+
#extracts the relevant data
|
35
|
+
@candidates.collect! do |candidate|
|
36
|
+
@hash = {}
|
37
|
+
candidate["FL"].collect do |pair|
|
38
|
+
pair = pair.to_a
|
39
|
+
@hash[pair.last.last.to_sym] = pair.first.last
|
40
|
+
end
|
41
|
+
@hash
|
42
|
+
end
|
43
|
+
@candidates
|
44
|
+
end
|
25
45
|
end
|
26
46
|
end
|
data/zohoho.gemspec
CHANGED