synsbasen_api 1.0.4 → 1.0.6

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: 99ac1f53e97c96f3f21e0ad5b3144df4c2afbaaee5b8af8a42e04e24d23e6b8c
4
- data.tar.gz: 6196d8929394e6b7a6271783ac34811f643a825c9db5852ef43fbba657ca6c70
3
+ metadata.gz: 0ec09887bb8b74dc5f47f9dcb332df43bc09fe4fcea136ec6d9aeac2b49bacd7
4
+ data.tar.gz: 0ce055a70a194f3d39f27b4e53dbb8cbb98dac3d1d6a1626c2cbe60c06137158
5
5
  SHA512:
6
- metadata.gz: 8add0e93e0efe3572e05d2704f90b5b45ae4b55091f5b609a9851fcb5645b4c20916691cf81e82d64b110dbfc5789e1b40d763044ff056a1774543ed1db5041e
7
- data.tar.gz: 0405b1d7b20293f55251956d6e70af0ef6450709c086c1e20b6dfdc9cea4ff107354b9a0967cf6dc18b9efab981e239cd8be3ab7408a1db33c654879ce5b5aa8
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
- @has_more = response[:has_more] || false
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module SynsbasenApi
4
4
  # The `VERSION` module specifies the version of the SynsbasenApi gem.
5
- VERSION = "1.0.4"
5
+ VERSION = "1.0.6"
6
6
  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
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-03 00:00:00.000000000 Z
12
+ date: 2024-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport