clearbit 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42909a92a17c963a6c1ee264beb4f5e92146cbc3
4
- data.tar.gz: 3ace91d26b734f8c0a2e8dc8060225483690b850
3
+ metadata.gz: 17c24d70918fb9e7eac659630aceb2dbfef52974
4
+ data.tar.gz: adb5b3e585772fbbe15bda1409ed6a8b82486950
5
5
  SHA512:
6
- metadata.gz: 1ad8d5be529ad305d469a9f8625d95d289130e5c39c70a05ec8bde625cf4180f7025c0a391e6cebf574aa44488c3efe95d402d4ca55954c3836af4daae0e2a15
7
- data.tar.gz: 9afdfeca84b1aaaf92e7bff79ba33024ce2620993cc318f05a9ce76700a9c1e10dac6525f23056da7e349a15c5e1baca5e4763969192a0efccc49899b28a993f
6
+ metadata.gz: 3ebbf52951763bb530c2e9a448d28cfc9277cce2143035422a67e852ab7ea25012168c596d24dfa1b77a86394acf0bef5fd6c9cb0905a003cef044e779dcb9fb
7
+ data.tar.gz: e59b9887faf2944097ee76097868e6588b49a55b527fe3fcf724870fc459153902b8cba7bc855877e1e4562791206355e76617a9b1c40b0ba1f34dff5c23cd36
@@ -1,4 +1,4 @@
1
1
  require 'clearbit'
2
2
  require 'pp'
3
3
 
4
- pp Clearbit::Company[domain: 'stripe.com']
4
+ pp Clearbit::Company.find(domain: 'stripe.com')
@@ -1,4 +1,4 @@
1
1
  require 'clearbit'
2
2
  require 'pp'
3
3
 
4
- pp Clearbit::Person[email: 'alex@alexmaccaw.com']
4
+ pp Clearbit::Person.find(email: 'alex@alexmaccaw.com')
@@ -0,0 +1,4 @@
1
+ require 'clearbit'
2
+ require 'pp'
3
+
4
+ pp Clearbit::PersonCompany.find(email: 'alex@alexmaccaw.com')
@@ -3,23 +3,29 @@ module Clearbit
3
3
  endpoint 'https://company.clearbit.com'
4
4
  path '/v1/companies'
5
5
 
6
- def self.find(values, options = {})
6
+ def self.find(values, old_options = nil)
7
7
  unless values.is_a?(Hash)
8
8
  values = {:id => values}
9
9
  end
10
10
 
11
- options = options.dup
12
- params = options.delete(:params) || {}
11
+ if old_options
12
+ # Deprecated API
13
+ warn '[DEPRECATION] passing multiple args to find() is deprecated'
14
+ values.merge!(old_options)
15
+ end
16
+
17
+ options = values.delete(:request) || {}
18
+ params = values.delete(:params) || {}
13
19
 
14
- if webhook_id = options.delete(:webhook_id)
20
+ if webhook_id = values.delete(:webhook_id)
15
21
  params.merge!(webhook_id: webhook_id)
16
22
  end
17
23
 
18
- if webhook_url = options.delete(:webhook_url)
24
+ if webhook_url = values.delete(:webhook_url)
19
25
  params.merge!(webhook_url: webhook_url)
20
26
  end
21
27
 
22
- if subscribe = options.delete(:subscribe)
28
+ if subscribe = values.delete(:subscribe)
23
29
  params.merge!(subscribe: subscribe)
24
30
  end
25
31
 
@@ -50,4 +56,4 @@ module Clearbit
50
56
  self.class.post(uri('flag'), attrs)
51
57
  end
52
58
  end
53
- end
59
+ end
@@ -3,23 +3,29 @@ module Clearbit
3
3
  endpoint 'https://person.clearbit.com'
4
4
  path '/v1/people'
5
5
 
6
- def self.find(values, options = {})
6
+ def self.find(values, old_options = nil)
7
7
  unless values.is_a?(Hash)
8
8
  values = {:id => values}
9
9
  end
10
10
 
11
- options = options.dup
12
- params = options.delete(:params) || {}
11
+ if old_options
12
+ # Deprecated API
13
+ warn '[DEPRECATION] passing multiple args to find() is deprecated'
14
+ values.merge!(old_options)
15
+ end
16
+
17
+ options = values.delete(:request) || {}
18
+ params = values.delete(:params) || {}
13
19
 
14
- if webhook_id = options.delete(:webhook_id)
20
+ if webhook_id = values.delete(:webhook_id)
15
21
  params.merge!(webhook_id: webhook_id)
16
22
  end
17
23
 
18
- if webhook_url = options.delete(:webhook_url)
24
+ if webhook_url = values.delete(:webhook_url)
19
25
  params.merge!(webhook_url: webhook_url)
20
26
  end
21
27
 
22
- if subscribe = options.delete(:subscribe)
28
+ if subscribe = values.delete(:subscribe)
23
29
  params.merge!(subscribe: subscribe)
24
30
  end
25
31
 
@@ -56,4 +62,4 @@ module Clearbit
56
62
  self.class.post(uri('flag'), attrs)
57
63
  end
58
64
  end
59
- end
65
+ end
@@ -3,23 +3,29 @@ module Clearbit
3
3
  endpoint 'https://person.clearbit.com'
4
4
  path '/v1/combined'
5
5
 
6
- def self.find(values, options = {})
6
+ def self.find(values, old_options = nil)
7
7
  unless values.is_a?(Hash)
8
8
  values = {:id => values}
9
9
  end
10
10
 
11
- options = options.dup
12
- params = options.delete(:params) || {}
11
+ if old_options
12
+ # Deprecated API
13
+ warn '[DEPRECATION] passing multiple args to find() is deprecated'
14
+ values.merge!(old_options)
15
+ end
16
+
17
+ options = values.delete(:request) || {}
18
+ params = values.delete(:params) || {}
13
19
 
14
- if webhook_id = options.delete(:webhook_id)
20
+ if webhook_id = values.delete(:webhook_id)
15
21
  params.merge!(webhook_id: webhook_id)
16
22
  end
17
23
 
18
- if webhook_url = options.delete(:webhook_url)
24
+ if webhook_url = values.delete(:webhook_url)
19
25
  params.merge!(webhook_url: webhook_url)
20
26
  end
21
27
 
22
- if subscribe = options.delete(:subscribe)
28
+ if subscribe = values.delete(:subscribe)
23
29
  params.merge!(subscribe: subscribe)
24
30
  end
25
31
 
@@ -41,4 +47,4 @@ module Clearbit
41
47
  alias_method :[], :find
42
48
  end
43
49
  end
44
- end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module Clearbit
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -15,5 +15,28 @@ module Clearbit
15
15
  class Entity < Watchlist
16
16
  path '/v1/search/entities'
17
17
  end
18
+
19
+ class Candidate < Watchlist
20
+ path '/v1/candidates'
21
+
22
+ def self.find(id, options = {})
23
+ response = get(id, {}, options)
24
+ self.new(response)
25
+ end
26
+
27
+ def self.all(options = {})
28
+ response = get('', {}, options)
29
+ self.new(response)
30
+ end
31
+
32
+ def self.create(params, options = {})
33
+ response = post('', params, options)
34
+ self.new(response)
35
+ end
36
+
37
+ def destroy
38
+ self.class.delete(id)
39
+ end
40
+ end
18
41
  end
19
- end
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clearbit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex MacCaw
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-21 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,6 +68,7 @@ files:
68
68
  - bin/clearbit
69
69
  - examples/company.rb
70
70
  - examples/person.rb
71
+ - examples/person_company.rb
71
72
  - examples/watchlist.rb
72
73
  - lib/clearbit.rb
73
74
  - lib/clearbit/base.rb
@@ -107,3 +108,4 @@ signing_key:
107
108
  specification_version: 4
108
109
  summary: API client for clearbit.com
109
110
  test_files: []
111
+ has_rdoc: