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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f918df7122a8d61288cb1f7b35ba225db9bada0dd5fadeeba2eda1bacc274ab9
4
- data.tar.gz: 7974b295fd53a2cae24b19903aade4677784dcc375da89ad79e0c79865c83669
3
+ metadata.gz: f92636f6a9ef3ed92abd0fba69609a827923c4c2f0f617b8b986921749282224
4
+ data.tar.gz: aa5352c332805b59a3057d17cf983691f2866d72de765df7c65d4bf12dc9e91b
5
5
  SHA512:
6
- metadata.gz: 3f24c74fd8d0d3ab608b9954388fdcf77b6fbc48c1043941dadf93ec04f67c95be539ea234dd0bf386cb8e7c8ea36717fac4cdb1de494e1a839bac358f72aa42
7
- data.tar.gz: af39ca592a3a8c016b91adf8832f1de9dbb9ec514f29a18acc6b39ef6087a5b9d4f6f67c8c583b341793541ff30b149b84d17a1ebf9091926bcf76ee4845cecf
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
 
@@ -15,7 +15,29 @@ module TravelTime
15
15
  end
16
16
 
17
17
  def parse_message(message)
18
- message || wrapped_exception&.message || response&.body&.[]('description') || DEFAULT_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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TravelTime
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
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.1.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-02-25 00:00:00.000000000 Z
11
+ date: 2022-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable