dnb-direct-ruby 0.0.7 → 0.0.8
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/lib/dnb/direct/plus/content.rb +15 -6
- data/lib/dnb/direct/version.rb +1 -1
- metadata +1 -2
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cc16645cf90cd64cd59ada8e706954ca61180e6
|
4
|
+
data.tar.gz: a3081c70721094e3bd599a3715225dd2f80f885d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba84c20ae23a11cbc3b88483d9b4ce77669c3e737acaeaf8aa143d68ff97b93de5bf2bda84e166b52fc042f8dc9f3514e7f740b291fca362b51cc7b63455d15a
|
7
|
+
data.tar.gz: 227e12ad4fa618a26708acbdd3230ed11f29d4b2554cc1dfdb3548c4be368610234b24ca456891b1719e76c855709cac52d148e09b94d577e6b11a9982aa345d
|
@@ -1,24 +1,34 @@
|
|
1
1
|
class DnB::Direct::Plus::Content
|
2
|
-
|
3
2
|
# This service is the most efficient way to gain basic marketing information
|
4
3
|
# about an existing customer or potential prospect such as business name,
|
5
4
|
# address, D&B® D-U-N-S® Number, phone and trade style. Includes business
|
6
5
|
# intelligence such as senior executive name, activities, sales, number of
|
7
6
|
# employees and owners.
|
8
7
|
def self.profile_with_linkage(params = {})
|
9
|
-
|
10
|
-
|
8
|
+
start = Time.now
|
9
|
+
puts "== Started profile_with_linkage at #{start}" if $LOG_DNB
|
11
10
|
response = DnB::Direct::Plus.connection.get do |req|
|
12
11
|
req.url "/v1/data/duns/#{params[:duns]}?productId=cmplnk&versionId=v1"
|
13
12
|
req.headers[:authorization] = "Bearer #{DnB::Direct::Plus.api_token}"
|
14
13
|
end
|
15
14
|
puts "== Completed in #{Time.now - start}s" if $LOG_DNB
|
16
15
|
org = DnB::Direct::Plus::Mappings::Organization.extract_single(response.body, :read)
|
17
|
-
org.payload = response.body if
|
16
|
+
org.payload = response.body if !org.nil? && org.respond_to?(:payload)
|
18
17
|
org
|
19
18
|
end # def self.profile_with_linkage
|
20
19
|
|
21
|
-
|
20
|
+
# Converts the object into textual markup given a specific `format`
|
21
|
+
# (defaults to `:html`)
|
22
|
+
#
|
23
|
+
# == Parameters:
|
24
|
+
# format::
|
25
|
+
# A Symbol declaring the format to convert the object to. This
|
26
|
+
# can be `:text` or `:html`.
|
27
|
+
#
|
28
|
+
# == Returns:
|
29
|
+
# A string representing the object in a specified
|
30
|
+
# format.
|
31
|
+
#
|
22
32
|
def self.plus_executives(params = {})
|
23
33
|
response = DnB::Direct::Plus.connection.get do |req|
|
24
34
|
req.url "/v1/data/duns/#{params[:duns]}?productId=cmpelk&versionId=v1"
|
@@ -27,5 +37,4 @@ class DnB::Direct::Plus::Content
|
|
27
37
|
|
28
38
|
JSON.parse(response.body)
|
29
39
|
end # def self.plus_executives
|
30
|
-
|
31
40
|
end # class
|
data/lib/dnb/direct/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dnb-direct-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Ihaia
|
@@ -137,7 +137,6 @@ extra_rdoc_files: []
|
|
137
137
|
files:
|
138
138
|
- ".gitignore"
|
139
139
|
- ".ruby-version"
|
140
|
-
- ".travis.yml"
|
141
140
|
- CODE_OF_CONDUCT.md
|
142
141
|
- Gemfile
|
143
142
|
- LICENSE.txt
|