synsbasen_api 1.0.4 → 1.0.6
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/synsbasen_api/api_response.rb +12 -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: 0ec09887bb8b74dc5f47f9dcb332df43bc09fe4fcea136ec6d9aeac2b49bacd7
|
4
|
+
data.tar.gz: 0ce055a70a194f3d39f27b4e53dbb8cbb98dac3d1d6a1626c2cbe60c06137158
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5626d8778158b88925117cdacd28131dc95fc1571ebe04b9306a1b446ac92d60d4067162ca0801b7105e1b161ed5e1b8773b2ca8dcc684ed670b9130a8a867f
|
7
|
+
data.tar.gz: ad7fba5fe84d5dae76cd87f767e67019e08c050fec7262af4a4ed32fbfc805c275837aede3622f2a417e3f6b36e0b33706b5292c4485bdbd3d07a43e777df094
|
@@ -12,16 +12,27 @@ 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
|
+
|
18
|
+
# @return [Numeric] The total count of items available.
|
19
|
+
attr_reader :total_count
|
20
|
+
|
15
21
|
# Initializes a new instance of `ApiResponse` with the provided response data.
|
16
22
|
#
|
17
23
|
# @param response [Hash] The response data from the API.
|
18
24
|
# @option response [Hash] :data The data included in the API response.
|
19
25
|
# @option response [Numeric] :cost The cost associated with the API response.
|
20
26
|
# @option response [Boolean] :has_more Indicates whether there is more data available in the response.
|
27
|
+
# @option response [Boolean] :total_pages The total number of pages available.
|
28
|
+
# @option response [Boolean] :total_count The total count of items available.
|
21
29
|
def initialize(response)
|
22
30
|
@data = response[:data]
|
23
31
|
@cost = response[:cost]
|
24
|
-
|
32
|
+
|
33
|
+
%i[has_more total_pages total_count].each do |key|
|
34
|
+
instance_variable_set("@#{key}", response[key]) if response.key?(key)
|
35
|
+
end
|
25
36
|
end
|
26
37
|
end
|
27
38
|
end
|
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.6
|
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: 2024-01-
|
12
|
+
date: 2024-01-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|