clearbit 0.0.7 → 0.0.8

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: 4de4fdad2dbe6a719030fd40ee632983cc65e930
4
- data.tar.gz: 449e06d2477c721c64d36c507ab2f8da19b28495
3
+ metadata.gz: 62de0c264e9a31b66e22a1367305f8fa2b64bd1e
4
+ data.tar.gz: b7ddc44248895bce32d13eeafdcac1a2ed9115f5
5
5
  SHA512:
6
- metadata.gz: 9af73d6a402bc52df8505e3ea8510a12401ed4be292d1ca23de82bcafcc5fff6e3b479abb92e3b672e5e2e6ba0c99af1cb48d111b746129976fe51c97787e37b
7
- data.tar.gz: 8eef0429b43b0396155003c33189e99cbdf9c2c9ce5d145ed72ca98ece530417dc7aafa2a6255dff36f72b19dd204ab98bd8755a124b80ed248057793bffee0c
6
+ metadata.gz: 522e5e1c1f407333f839b87d7e16a09fe3a3670d453041d497afe5c80b9cbd2c2c5094e81f652d6482bd07dfb96d04142917a02c7b785de7c49c61cfcaef42c0
7
+ data.tar.gz: 8c1c5b067d886ff523c63524a10c091dac9137f317c9f4d9eff9b4fd4414038dcc1b1a30825ba3514353c71c23282858a361f31b9bff7fc7165ae0ec5ab6c33f
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  First authorize requests by setting the API key found on your [account's settings page](https://clearbit.co/profile).
22
22
 
23
- Clearbit.api_key = ENV['APIHUB_KEY']
23
+ Clearbit.key = ENV['CLEARBIT_KEY']
24
24
 
25
25
  Then you can lookup people by email address:
26
26
 
data/examples/email.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'clearbit'
2
2
  require 'pp'
3
3
 
4
- Clearbit.api_key = ENV['CLEARBIT_KEY']
4
+ Clearbit.api_key = ENV['CLEARBIT_KEY_LOCAL']
5
5
 
6
6
  pp Clearbit::Person[email: 'info@eribium.org']
data/lib/clearbit.rb CHANGED
@@ -17,6 +17,7 @@ module Clearbit
17
17
  autoload :Company, 'clearbit/company'
18
18
  autoload :Mash, 'clearbit/mash'
19
19
  autoload :Person, 'clearbit/person'
20
+ autoload :PersonCompany, 'clearbit/person_company'
20
21
  autoload :Resource, 'clearbit/resource'
21
22
  autoload :Streaming, 'clearbit/streaming'
22
23
  autoload :Watchlist, 'clearbit/watchlist'
@@ -11,6 +11,18 @@ module Clearbit
11
11
  options = options.dup
12
12
  params = options.delete(:params) || {}
13
13
 
14
+ if webhook_id = options.delete(:webhook_id)
15
+ params.merge!(webhook_id: webhook_id)
16
+ end
17
+
18
+ if webhook_url = options.delete(:webhook_url)
19
+ params.merge!(webhook_url: webhook_url)
20
+ end
21
+
22
+ if subscribe = options.delete(:subscribe)
23
+ params.merge!(subscribe: subscribe)
24
+ end
25
+
14
26
  if domain = values[:domain]
15
27
  response = get(uri(:domain, domain), params, options)
16
28
 
@@ -11,6 +11,18 @@ module Clearbit
11
11
  options = options.dup
12
12
  params = options.delete(:params) || {}
13
13
 
14
+ if webhook_id = options.delete(:webhook_id)
15
+ params.merge!(webhook_id: webhook_id)
16
+ end
17
+
18
+ if webhook_url = options.delete(:webhook_url)
19
+ params.merge!(webhook_url: webhook_url)
20
+ end
21
+
22
+ if subscribe = options.delete(:subscribe)
23
+ params.merge!(subscribe: subscribe)
24
+ end
25
+
14
26
  if email = values[:email]
15
27
  response = get(uri(:email, email), params, options)
16
28
 
@@ -0,0 +1,44 @@
1
+ module Clearbit
2
+ class PersonCompany < Base
3
+ endpoint 'https://person.clearbit.co'
4
+ path '/v1/combined'
5
+
6
+ def self.find(values, options = {})
7
+ unless values.is_a?(Hash)
8
+ values = {:id => values}
9
+ end
10
+
11
+ options = options.dup
12
+ params = options.delete(:params) || {}
13
+
14
+ if webhook_id = options.delete(:webhook_id)
15
+ params.merge!(webhook_id: webhook_id)
16
+ end
17
+
18
+ if webhook_url = options.delete(:webhook_url)
19
+ params.merge!(webhook_url: webhook_url)
20
+ end
21
+
22
+ if subscribe = options.delete(:subscribe)
23
+ params.merge!(subscribe: subscribe)
24
+ end
25
+
26
+ if email = values[:email]
27
+ response = get(uri(:email, email), params, options)
28
+ else
29
+ raise ArgumentError, 'Invalid values'
30
+ end
31
+
32
+ if response.status == 202
33
+ self.new(pending: true)
34
+ else
35
+ self.new(response)
36
+ end
37
+ rescue Nestful::ResourceNotFound
38
+ end
39
+
40
+ class << self
41
+ alias_method :[], :find
42
+ end
43
+ end
44
+ end
@@ -2,5 +2,6 @@ module Clearbit
2
2
  module Streaming
3
3
  autoload :Company, 'clearbit/streaming/company'
4
4
  autoload :Person, 'clearbit/streaming/person'
5
+ autoload :PersonCompany, 'clearbit/streaming/person_company'
5
6
  end
6
7
  end
@@ -0,0 +1,7 @@
1
+ module Clearbit
2
+ module Streaming
3
+ class PersonCompany < Clearbit::PersonCompany
4
+ endpoint 'https://person-stream.clearbit.co'
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Clearbit
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  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.0.7
4
+ version: 0.0.8
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-08-26 00:00:00.000000000 Z
11
+ date: 2014-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,10 +73,12 @@ files:
73
73
  - lib/clearbit/company.rb
74
74
  - lib/clearbit/mash.rb
75
75
  - lib/clearbit/person.rb
76
+ - lib/clearbit/person_company.rb
76
77
  - lib/clearbit/resource.rb
77
78
  - lib/clearbit/streaming.rb
78
79
  - lib/clearbit/streaming/company.rb
79
80
  - lib/clearbit/streaming/person.rb
81
+ - lib/clearbit/streaming/person_company.rb
80
82
  - lib/clearbit/version.rb
81
83
  - lib/clearbit/watchlist.rb
82
84
  homepage: https://github.com/maccman/clearbit-ruby