Method: TTY::Pager::ClassMethods#new

Defined in:
lib/tty/pager.rb

#new(enabled: true, command: nil, **options) ⇒ Object

Create a pager

Parameters:

  • :enabled (Boolean)

    disable/enable text paging

  • :command (String)

    the paging command

  • :input (IO)

    the object to send input to

  • :output (IO)

    the object to send output to

  • :prompt (Proc)

    a proc object that accepts page number

  • :width (Integer)

    the terminal width

  • :height (Integer)

    the terminal height



37
38
39
40
# File 'lib/tty/pager.rb', line 37

def new(enabled: true, command: nil, **options)
  select_pager(enabled: enabled, command: command).new(
    enabled: enabled, command: command, **options)
end