synsbasen_api 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/synsbasen_api/api_response.rb +7 -1
- data/lib/synsbasen_api/resources/vehicle.rb +4 -1
- data/lib/synsbasen_api/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: 488fa94b15f086f18590d5e13bda9455648fbdc8794b639760bf5b39708b74f5
|
4
|
+
data.tar.gz: b6f821fc79f849a6a97927e65f39a68896b08307579b0bf62b09c3f606b22b29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4ab45d11acbfecd31e8f925952697f84f5a41bee63f941a5eb7d14600ce6e6c88b38f7b0c5d0d663bcba393f4ac89b1463f1f2ed1396663e767dfddb5712389
|
7
|
+
data.tar.gz: eea99086d568db341f04f43e1e54048126a658c4dbd753e83b127b232f83121c8721a690bd503a86e0b206bc4d5ea7a9fd44c20f08341978d4b7704983579d3e
|
@@ -12,6 +12,9 @@ module SynsbasenApi
|
|
12
12
|
# @return [Boolean] Indicates whether there is more data available in the response.
|
13
13
|
attr_reader :has_more
|
14
14
|
|
15
|
+
# @return [Numeric] The total number of pages available.
|
16
|
+
attr_reader :total_pages
|
17
|
+
|
15
18
|
# Initializes a new instance of `ApiResponse` with the provided response data.
|
16
19
|
#
|
17
20
|
# @param response [Hash] The response data from the API.
|
@@ -21,7 +24,10 @@ module SynsbasenApi
|
|
21
24
|
def initialize(response)
|
22
25
|
@data = response[:data]
|
23
26
|
@cost = response[:cost]
|
24
|
-
|
27
|
+
|
28
|
+
%i[has_more total_pages].each do |key|
|
29
|
+
instance_variable_set("@#{key}", response[key]) if response.key?(key)
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
27
33
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'cgi/escape'
|
4
|
+
|
3
5
|
module SynsbasenApi
|
4
6
|
# The `Vehicle` class provides methods for interacting with vehicle-related
|
5
7
|
# endpoints in the Synsbasen API. It extends the `Client` class.
|
@@ -20,7 +22,8 @@ module SynsbasenApi
|
|
20
22
|
# @return [ApiResponse] An instance of `ApiResponse` containing details
|
21
23
|
# of the specified vehicle.
|
22
24
|
def find_by_registration(registration, expand: [])
|
23
|
-
|
25
|
+
escaped_registration = CGI.escape(registration)
|
26
|
+
get("/v1/vehicles/registration/#{escaped_registration}", expand: expand)
|
24
27
|
end
|
25
28
|
|
26
29
|
# Retrieves information about a vehicle based on its VIN (Vehicle Identification Number).
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synsbasen_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Poulsen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-01-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|