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.
@@ -4,7 +4,7 @@ module Zohoho
4
4
 
5
5
  class Connection
6
6
  include HTTParty
7
- default_timeout 20
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).parsed_response =~ /TICKET=(\w+)/
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)
@@ -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 ||= get_candidates(conditions)
31
+ @candidates = get_candidates(conditions)
28
32
  end
29
33
 
30
- def get_parsed_candidates(conditions = {:fromIndex => 1, :toIndex => 200})
34
+ def get_parsed_candidates(conditions)
31
35
  raw_candidates = candidates(conditions)
32
36
  @candidates = raw_candidates["response"]["result"]["Candidates"]["row"]
33
37
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{zohoho}
8
- s.version = "0.2.5.3"
8
+ s.version = "0.2.5.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["KentonWhite", "Elland"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: zohoho
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.5.3
5
+ version: 0.2.5.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - KentonWhite