# Returns true if this paginator contains the page of index +number+.
def contains_page?(number)
- number >= 1 && number <= page_count
+ number.between?(1, page_count)
end
# Returns a new Page representing the page with the given index
end
# Successively yields all the paginator's pages to the given block.
- def each(&_block)
+ def each(&)
page_count.times do |n|
yield self[n + 1]
end