manageiq-api-common 1.0.0 → 1.0.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c8d656cee54b8c74a2657c8102480ee5682a2af50f14d02ce345668425983db
|
4
|
+
data.tar.gz: 7204efad0cbab35cdbbb70eb046059fd1a5de69d6630a77c6806ba39125a30c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf2b4452a59e4eea346b73eff624639ac10f93a1e361e44e5a9fe6985c9955c146484d1c7320cce950617c066c37e75a70fe33f41634f8942073ff6bf2d7abdf
|
7
|
+
data.tar.gz: b42783172cf71e6487d48ece8ca85bbd25322fa5a547e8953a2da52eab00c966910508aff6c4eeb85a3aff0cb6d9e1e3f683a95fb53df9edd25e6b35e75b0fbb
|
@@ -47,16 +47,17 @@ module ManageIQ
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def link_to_prev
|
50
|
-
return if
|
50
|
+
return if offset == 0
|
51
|
+
prev_offset = offset - limit
|
51
52
|
|
52
|
-
link_with_new_offset((
|
53
|
+
link_with_new_offset(prev_offset.clamp(0, Float::INFINITY))
|
53
54
|
end
|
54
55
|
|
55
56
|
def link_to_next
|
56
|
-
|
57
|
-
return if
|
57
|
+
next_offset = limit + offset
|
58
|
+
return if next_offset >= count
|
58
59
|
|
59
|
-
link_with_new_offset(
|
60
|
+
link_with_new_offset(next_offset)
|
60
61
|
end
|
61
62
|
|
62
63
|
def link_with_new_offset(offset)
|
@@ -75,10 +76,6 @@ module ManageIQ
|
|
75
76
|
@request_uri ||= URI.parse(@request.original_url)
|
76
77
|
end
|
77
78
|
|
78
|
-
def current_limit_multiplier
|
79
|
-
@current_limit_multiplier ||= offset / limit
|
80
|
-
end
|
81
|
-
|
82
79
|
def max_limit_multiplier
|
83
80
|
@max_limit_multiplier ||= ((count - 1) / limit)
|
84
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manageiq-api-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ManageIQ Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acts_as_tenant
|