zohoho 0.2.5.3 → 0.2.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/zohoho/connection.rb +2 -2
- data/lib/zohoho/recruit.rb +7 -3
- data/zohoho.gemspec +1 -1
- metadata +1 -1
data/lib/zohoho/connection.rb
CHANGED
@@ -4,7 +4,7 @@ module Zohoho
|
|
4
4
|
|
5
5
|
class Connection
|
6
6
|
include HTTParty
|
7
|
-
default_timeout
|
7
|
+
default_timeout 40
|
8
8
|
|
9
9
|
def initialize(service_name, username, password, apikey)
|
10
10
|
@service_name, @username, @password, @api_key = service_name, username, password, apikey
|
@@ -23,7 +23,7 @@ module Zohoho
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def ticket
|
26
|
-
Regexp.last_match(1) if self.class.get(ticket_url).
|
26
|
+
Regexp.last_match(1) if self.class.get(ticket_url).to_s =~ /TICKET=(\w+)/
|
27
27
|
end
|
28
28
|
|
29
29
|
def call(entry, api_method, query = {}, http_method = :get)
|
data/lib/zohoho/recruit.rb
CHANGED
@@ -6,6 +6,10 @@ module Zohoho
|
|
6
6
|
class Recruit
|
7
7
|
include HTTParty
|
8
8
|
|
9
|
+
def set_default_timeout(t)
|
10
|
+
default_timeout t
|
11
|
+
end
|
12
|
+
|
9
13
|
def initialize(username, password, apikey, type = 'json')
|
10
14
|
@type = type
|
11
15
|
@conn = Zohoho::Connection.new 'zohopeople', username, password, apikey
|
@@ -19,15 +23,15 @@ module Zohoho
|
|
19
23
|
"http://recruit.zoho.com/ats/private/#{type}/Candidates/getRecords?apikey=#{@conn.api_key}&ticket=#{@conn.ticket}"
|
20
24
|
end
|
21
25
|
|
22
|
-
def get_candidates(conditions = {})
|
26
|
+
def get_candidates(conditions = {:fromIndex => 1, :toIndex => 100})
|
23
27
|
(@type == 'json' ? JSON.parse(self.class.get(candidates_url+"&#{conditions.to_params}")) : Nokogiri::XML.parse(self.class.get(candidates_url, conditions)))
|
24
28
|
end
|
25
29
|
|
26
30
|
def candidates(conditions = {})
|
27
|
-
@candidates
|
31
|
+
@candidates = get_candidates(conditions)
|
28
32
|
end
|
29
33
|
|
30
|
-
def get_parsed_candidates(conditions
|
34
|
+
def get_parsed_candidates(conditions)
|
31
35
|
raw_candidates = candidates(conditions)
|
32
36
|
@candidates = raw_candidates["response"]["result"]["Candidates"]["row"]
|
33
37
|
|
data/zohoho.gemspec
CHANGED