rail-locator-api 1.0.34 → 1.0.35
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/rail-locator-api/api_request.rb +1 -1
- data/lib/rail-locator-api/response.rb +3 -2
- data/lib/rail-locator-api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b615e28535741f010ad218a4f844b1ed47d83e05841d4b87035181959316bbe
|
4
|
+
data.tar.gz: b0970713fd66072b17b29611523620a8a2aa2055987212c19e400a6bbb6cd5eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c609f8abe8f9ab850dfae270eb47c5d9776cf9274239adbdc250a9b153d92905061677c26ab88f6363e02bf7aa17bbc8c57d6f5f3d0260561320ec58695db2ff
|
7
|
+
data.tar.gz: c98d9b3f48a73a2c9ac4f6f51044a245f6391ec9c2fd82064edc95b3be1358dd86178faac77c51c1d369a064e5358af133ed932ff57852aff9ccca2f06742988
|
@@ -311,7 +311,7 @@ module RailLocatorApi
|
|
311
311
|
begin
|
312
312
|
headers = response.headers
|
313
313
|
body = MultiJson.load(response.body, symbolize_keys: symbolize_keys)
|
314
|
-
parsed_response = Response.new(headers: headers, body: body)
|
314
|
+
parsed_response = Response.new(headers: headers, body: body, status_code: response.env.status)
|
315
315
|
rescue MultiJson::ParseError
|
316
316
|
error_params = { title: "UNPARSEABLE_RESPONSE", status_code: 500 }
|
317
317
|
error = RailLocatorApiError.new("Unparseable response: #{response.body}", error_params)
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module RailLocatorApi
|
2
2
|
class Response
|
3
|
-
attr_accessor :body, :headers
|
3
|
+
attr_accessor :body, :headers, :status_code
|
4
4
|
|
5
|
-
def initialize(body: {}, headers: {})
|
5
|
+
def initialize(body: {}, headers: {}, status_code: nil)
|
6
6
|
@body = body
|
7
7
|
@headers = headers
|
8
|
+
@status_code = status_code
|
8
9
|
end
|
9
10
|
end
|
10
11
|
end
|