Method: TTY::Pager::BasicPager#initialize
- Defined in:
- lib/tty/pager/basic.rb
#initialize(height: TTY::Screen.height, width: TTY::Screen.width, prompt: DEFAULT_PROMPT, **options) ⇒ BasicPager
Create a basic pager
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/tty/pager/basic.rb', line 36 def initialize(height: TTY::Screen.height, width: TTY::Screen.width, prompt: DEFAULT_PROMPT, **) super(**) @width = width @prompt = prompt prompt_height = Strings.wrap(prompt.call(100).to_s, width).lines.count @page_cursor = PageCursor.new(height - prompt_height) reset end |