each_page returns Enumerator unless block_given
This commit is contained in:
parent
2cc02d89fa
commit
f23655cc24
|
@ -25,6 +25,8 @@ module Kaminari
|
|||
|
||||
# enumerate each page providing PageProxy object as the block parameter
|
||||
def each_page
|
||||
return to_enum(:each_page) unless block_given?
|
||||
|
||||
1.upto(@options[:num_pages]) do |i|
|
||||
yield PageProxy.new(@window_options.merge(@options), i, @last)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue