blackbook_client 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/autocomplete_service.rb +6 -1
- data/lib/blackbook_client/version.rb +1 -1
- data/lib/chromedata_service.rb +1 -1
- data/lib/rest_client.rb +3 -3
- data/lib/uvc_service.rb +1 -1
- data/lib/vin_service.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0783110099725e64738025e82b866b8ec931f6c7df14127470cb7e009788f20
|
4
|
+
data.tar.gz: 03cc321bd8a086a9524375aa253d87d9fa7a6640e6dfae4f3b66cfe5158f2211
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f0ba156518d25270303373f292a3166ed18bac5b4e2566f524aee2de949965da4097fe808d131e8334a0da1449a0fac12367132ded67eaeffb25a1635ab84b5
|
7
|
+
data.tar.gz: b2a5b0927df231fcfdca58509f8f11929d7a636d3d117114375087264bbe1781dbc5f3bce22e599a3c9eebe2440a74e0ff23e0fda4b546d918cc5bf37efb37c6
|
data/Gemfile.lock
CHANGED
data/lib/autocomplete_service.rb
CHANGED
@@ -6,9 +6,14 @@ module AutocompleteService
|
|
6
6
|
def lookup_autocomplete(query_params = {})
|
7
7
|
begin
|
8
8
|
response = HTTParty.get(VEHICLE_AUTOCOMPLETE_URL, headers: headers, query: query_params)
|
9
|
-
process_response(JSON.parse(response))
|
9
|
+
process_response(JSON.parse(response), :transformer)
|
10
10
|
rescue => e
|
11
11
|
[{ error: e.to_s }, 500]
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
def transformer(response)
|
16
|
+
return [] unless response && response['autocomplete']
|
17
|
+
response['autocomplete']
|
18
|
+
end
|
14
19
|
end
|
data/lib/chromedata_service.rb
CHANGED
data/lib/rest_client.rb
CHANGED
@@ -6,14 +6,14 @@ module RestClient
|
|
6
6
|
{ Authorization: "Basic #{token}" }
|
7
7
|
end
|
8
8
|
|
9
|
-
def process_response(response)
|
9
|
+
def process_response(response, transformer = nil)
|
10
10
|
status = 200
|
11
11
|
|
12
12
|
if response['error_count'].positive?
|
13
13
|
response = { error: response['message_list'][0]['description'] }
|
14
14
|
status = 400
|
15
|
-
|
16
|
-
response =
|
15
|
+
elsif transformer
|
16
|
+
response = send(transformer, response)
|
17
17
|
end
|
18
18
|
|
19
19
|
[response, status]
|
data/lib/uvc_service.rb
CHANGED
data/lib/vin_service.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blackbook_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Schmeichel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|