dimples 7.0.2 → 7.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dimples/pager.rb +3 -3
- data/lib/dimples/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fd729f8831f7117dec77633ca687cb478952d674c26e1c4720f12bc2a019ff8
|
4
|
+
data.tar.gz: ecc6f32cb1c207f1b1c57bec0ec770706680a86f3c9ef75796a61ad9eea7e89a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e75b7b11f69b44d2015cd0262c1c3d93f87df7f78af881ef193e2de6b63e8ece2f0ae31649d73f27dbeb15c3a676c9a05b178a48f768ee1416abfe132a29fdbd
|
7
|
+
data.tar.gz: c8e6a752a8b64b5aeae3cefa9faf82f3a1d25d7051c664a93ad2ec6f813274805feae18f19adeefe4c8ae8cc14ac3f4ce85163ec1fd3a305905d2229b0098ff5
|
data/lib/dimples/pager.rb
CHANGED
@@ -11,11 +11,11 @@ module Dimples
|
|
11
11
|
attr_reader :next_page
|
12
12
|
attr_reader :page_count
|
13
13
|
|
14
|
-
def initialize(url, posts)
|
14
|
+
def initialize(url, posts, options = {})
|
15
15
|
@url = url
|
16
16
|
@posts = posts
|
17
|
-
@per_page = PER_PAGE
|
18
|
-
@page_prefix = 'page_'
|
17
|
+
@per_page = options.fetch(:per_page, PER_PAGE)
|
18
|
+
@page_prefix = options.fetch(:page_prefix, 'page_')
|
19
19
|
@page_count = (posts.length.to_f / @per_page.to_i).ceil
|
20
20
|
|
21
21
|
step_to(1)
|
data/lib/dimples/version.rb
CHANGED