class Term::Prompt::Paginator

Direct Known Subclasses

Defined in:

prompt/paginator.cr

Constant Summary

DEFAULT_PAGE_SIZE = 6

Constructors

Instance Method Summary

Constructor Detail

def self.new(**options) #

Create a Paginator


[View source]

Instance Method Detail

def check_page_size! #

Check if page size is valid


[View source]
def current_index : Int32 #

The 0-based index of the active item on this page


[View source]
def end_index : Int32 | Nil #

The 0-based index of the last item on this page


[View source]
def last_index : Int32 #

The 0-based index of the previously active item on this page


[View source]
def paginate(list, active, page_size = nil, &block : Choice, Int32 -> ) #

Paginate collection given an active index


[View source]
def paginate(list, active, page_size = nil) #

Paginate collection given an active index


[View source]
def reset! #

Reset current page indexes


[View source]
def start_index : Int32 | Nil #

The 0-based index of the first item on this page


[View source]
def start_index=(start_index : Int32 | Nil) #

The 0-based index of the first item on this page


[View source]