travel_time 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/travel_time/error.rb +23 -1
- data/lib/travel_time/version.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: f92636f6a9ef3ed92abd0fba69609a827923c4c2f0f617b8b986921749282224
|
4
|
+
data.tar.gz: aa5352c332805b59a3057d17cf983691f2866d72de765df7c65d4bf12dc9e91b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45cd2bd0a182a170afb7569720bbe4acb9010e307b75dcdce56917b0ed4efe073934a98d24f838319e7e64b0c020df4ada6340b798fde13de5da5c1b5c15e9da
|
7
|
+
data.tar.gz: c2ef831952436c81bd1519065c4217dde55fffce7f976a55564304b7b9fa395809b7d6a62893c7dc046d607e1b89fe108042a4c1afd21a4b02b8620604c66408
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# TravelTime Ruby SDK
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/travel_time.svg)](https://rubygems.org/gems/travel_time)
|
4
|
+
[![GitHub Actions CI](https://github.com/traveltime-dev/traveltime-sdk-ruby/workflows/CI/badge.svg)](https://github.com/traveltime-dev/traveltime-sdk-ruby/actions?query=workflow%3ACI)
|
5
|
+
|
6
|
+
|
3
7
|
This open-source library allows you to access [TravelTime API](http://docs.traveltime.com/overview/introduction)
|
4
8
|
endpoints.
|
5
9
|
|
data/lib/travel_time/error.rb
CHANGED
@@ -15,7 +15,29 @@ module TravelTime
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def parse_message(message)
|
18
|
-
message || wrapped_exception&.message ||
|
18
|
+
message || wrapped_exception&.message || description || DEFAULT_MESSAGE
|
19
|
+
end
|
20
|
+
|
21
|
+
def description
|
22
|
+
extract_from_body('description')
|
23
|
+
end
|
24
|
+
|
25
|
+
def error_code
|
26
|
+
extract_from_body('error_code')
|
27
|
+
end
|
28
|
+
|
29
|
+
def additional_info
|
30
|
+
extract_from_body('additional_info')
|
31
|
+
end
|
32
|
+
|
33
|
+
def documentation_link
|
34
|
+
extract_from_body('documentation_link')
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def extract_from_body(field)
|
40
|
+
response&.body&.[](field)
|
19
41
|
end
|
20
42
|
end
|
21
43
|
end
|
data/lib/travel_time/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: travel_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TravelTime Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|