fc_enrich 0.1.1 → 0.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +18 -0
- data/lib/fc_enrich.rb +9 -0
- data/lib/fc_enrich/fake_client.rb +8 -0
- data/lib/fc_enrich/fake_client/post_v3_person.enrich.json +14 -0
- data/lib/fc_enrich/person_enrich_request.rb +1 -1
- data/lib/fc_enrich/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28486a32bc0719b366a68da8ed39af8a2c61db9ce4fbc40ea504be13b44d4ef0
|
4
|
+
data.tar.gz: e5dd106359bf2fd9967c846b3cc4f3011aee2ffb2c2c76ce8efccb2277ab4045
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c21fc3da004259439e6bf9ec06349fcc80a483c1f328a84e2cf343ab5f1370ec4224199068ed8270b2f48334b6ea389b00350f4ed5e8284a6dd2163d1dcd1d0
|
7
|
+
data.tar.gz: aed0a3f867c172266cde65284ae361350cc882cf7a2b99f7a1fc58804ca0c85fea0c361c28a9c34c407f06cac7a9b0936167e64fe221dbc683532097d5539ab0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -64,6 +64,24 @@ see https://platform.fullcontact.com/docs/apis/enrich/multi-field-request
|
|
64
64
|
data_filter: ["social", "employment_history"])
|
65
65
|
```
|
66
66
|
|
67
|
+
## Usage Testing
|
68
|
+
|
69
|
+
Inside your tests can enable fake mode which will always return the same sample json
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
Rspec.describe "Test" do
|
73
|
+
before :each do
|
74
|
+
allow(FcEnrich).to receive(:use_fake?).and_return(true)
|
75
|
+
end
|
76
|
+
|
77
|
+
it 'returns sample client info' do
|
78
|
+
person_request = FcEnrich::PersonEnrichRequest.new(email: "any@email.com")
|
79
|
+
person = person_request.perform
|
80
|
+
expect(person.full_name).to eq("Bart Lorang")
|
81
|
+
end
|
82
|
+
end
|
83
|
+
```
|
84
|
+
|
67
85
|
## Development
|
68
86
|
|
69
87
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/fc_enrich.rb
CHANGED
@@ -11,6 +11,15 @@ module FcEnrich
|
|
11
11
|
def self.api_key
|
12
12
|
@key
|
13
13
|
end
|
14
|
+
|
15
|
+
def self.http_client
|
16
|
+
use_fake? ? FakeClient.new : HttpClient.new
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.use_fake?
|
20
|
+
false
|
21
|
+
end
|
14
22
|
end
|
15
23
|
|
16
24
|
require 'fc_enrich/person_enrich_request'
|
25
|
+
require 'fc_enrich/fake_client'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"fullName": "Bart Lorang",
|
3
|
+
"ageRange": "30-39",
|
4
|
+
"gender": "Male",
|
5
|
+
"location": "Denver, CO, United States",
|
6
|
+
"title": "Co-Founder & Managing Director",
|
7
|
+
"organization": "V1.vc",
|
8
|
+
"twitter": "https://twitter.com/bartlorang",
|
9
|
+
"linkedin": "https://www.linkedin.com/in/bartlorang",
|
10
|
+
"bio": "CEO & Co-Founder of @FullContact, Managing Director @v1vc_. Tech Entrepreneur, Investor. Husband to @parkerbenson and Father to Greyson Lorang",
|
11
|
+
"avatar": "https://d2ojpxxtu63wzl.cloudfront.net/static/a7e6a5aba590d4933e35eaadabd97fd2_44e00e968ac57725a15b32f9ca714827aff8e4818d290cb0c611f2e2585253b3",
|
12
|
+
"details": {}
|
13
|
+
}
|
14
|
+
|
data/lib/fc_enrich/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fc_enrich
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grant Petersen-Speelman
|
@@ -111,6 +111,8 @@ files:
|
|
111
111
|
- fc_enrich.gemspec
|
112
112
|
- gems.rb
|
113
113
|
- lib/fc_enrich.rb
|
114
|
+
- lib/fc_enrich/fake_client.rb
|
115
|
+
- lib/fc_enrich/fake_client/post_v3_person.enrich.json
|
114
116
|
- lib/fc_enrich/http_client.rb
|
115
117
|
- lib/fc_enrich/person_enrich_request.rb
|
116
118
|
- lib/fc_enrich/version.rb
|