bridgetown-paginate 2.0.0.beta3 → 2.0.0.beta4

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: 71911c3f6dd305dea28d01ef38dbab364eafc741c0a03189cc2f8ed54ea4bf9b
4
- data.tar.gz: 92752b8630954e4205cc895e9df4424028d6df77bf4dd24718bcf3eb5657fe61
3
+ metadata.gz: b2304a6c28c99c9d0341e005d1d20628c7230bfa265f4582d847282af8d7b29c
4
+ data.tar.gz: 264d4ea5d26af8c5113032621d380c584f5a0c00725a6c6ff709041230b824cc
5
5
  SHA512:
6
- metadata.gz: 396fd1f6ee30a845e7ce8fd7f8eadcba725c822138579f84fd1ccc24f0993daad3438173af1be9e7d0c712c969274a3b28a811d3954ae4e4ad8df70cea91334f
7
- data.tar.gz: c80bbb15abcb43dd1211e4ab26e384e7056adb5e30a8ab8fe8e7a1a20ec41b5b890a66beec90f75a7c83074e2f6bcfb98fe12305380ba9d7d77b7cca78e64616
6
+ metadata.gz: 6fc4577796f008622838805616b14e55ccf6cdef020b6fa600d7bcbbe3d10113675b3d310f719389b6e9de5401d0bedd589cc44821ad3bc2e82132b52066215c
7
+ data.tar.gz: 67decf60c8a474a2d0e4847df113d3b38b2826ed95a62729db75363fe4c7baf4ef37330aa6320e86e94adbbddf11a7c28d11067aa0de1fff272c397f67b32f11
@@ -6,6 +6,8 @@ module Bridgetown
6
6
  # Handles the preparation of all the documents based on the current page index
7
7
  #
8
8
  class Paginator
9
+ include Enumerable
10
+
9
11
  attr_reader :page, :per_page, :documents, :total_documents, :total_pages,
10
12
  :previous_page, :previous_page_path, :next_page, :next_page_path, :page_path,
11
13
  :first_page, :first_page_path, :last_page, :last_page_path
@@ -119,6 +121,18 @@ module Bridgetown
119
121
  "page_trail" => page_trail,
120
122
  }
121
123
  end
124
+
125
+ # Iterate over Resources by delegating to `resources.each` (supports Enumerable)
126
+ def each(...) = resources.each(...)
127
+
128
+ # Delegates to `resources.last`
129
+ def last(...) = resources.last(...)
130
+
131
+ # Delegates to `resources.deconstruct`
132
+ def deconstruct = resources.deconstruct
133
+
134
+ # Delegates to `resources[]`
135
+ def [](...) = resources.[](...)
122
136
  end
123
137
 
124
138
  # Small utility class that handles individual pagination trails
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta3
4
+ version: 2.0.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-16 00:00:00.000000000 Z
11
+ date: 2025-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.0.beta3
19
+ version: 2.0.0.beta4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.0.beta3
26
+ version: 2.0.0.beta4
27
27
  description:
28
28
  email: maintainers@bridgetownrb.com
29
29
  executables: []