lib/tty/prompt/enum_paginator.rb in tty-prompt-0.13.2 vs lib/tty/prompt/enum_paginator.rb in tty-prompt-0.14.0
- old
+ new
@@ -11,9 +11,11 @@
# @api public
def paginate(list, active, per_page = nil, &block)
default_size = (list.size <= DEFAULT_PAGE_SIZE ? list.size : DEFAULT_PAGE_SIZE)
@per_page = @per_page || per_page || default_size
+ check_page_size!
+
# Don't paginate short lists
if list.size <= @per_page
@lower_index = 0
@upper_index = list.size - 1
if block