paginator 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/paginator.rb +2 -1
- metadata +2 -2
data/History.txt
CHANGED
data/lib/paginator.rb
CHANGED
@@ -2,7 +2,7 @@ require 'forwardable'
|
|
2
2
|
|
3
3
|
class Paginator
|
4
4
|
|
5
|
-
VERSION = '1.0.
|
5
|
+
VERSION = '1.0.1'
|
6
6
|
|
7
7
|
class ArgumentError < ::ArgumentError; end
|
8
8
|
class MissingCountError < ArgumentError; end
|
@@ -51,6 +51,7 @@ class Paginator
|
|
51
51
|
|
52
52
|
# Retrieve page object by number
|
53
53
|
def page(number)
|
54
|
+
number = (n = number.to_i) > 0 ? n : 1
|
54
55
|
Page.new(self, number, lambda{ @select.call((number - 1) * @per_page, @per_page) })
|
55
56
|
end
|
56
57
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: paginator
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2006-10-
|
6
|
+
version: 1.0.1
|
7
|
+
date: 2006-10-24 00:00:00 -06:00
|
8
8
|
summary: A generic paginator object for use in any Ruby program
|
9
9
|
require_paths:
|
10
10
|
- lib
|