Method: TTY::Pager::ClassMethods#page

Defined in:
lib/tty/pager.rb

#page(text = nil, path: nil, enabled: true, command: nil, **options, &block) ⇒ Object

Paginate content through null, basic or system pager.

Examples:

TTY::Pager.page do |pager|
  pager.write "some text"
end

Parameters:

  • :text (String)

    an optional blob of content

  • :path (String)

    a path to a file

  • :enabled (Boolean)

    whether or not to use null pager

  • :command (String)

    the paging command

  • :input (IO)

    the object to send input to

  • :output (IO)

    the object to send output to



63
64
65
66
67
68
# File 'lib/tty/pager.rb', line 63

def page(text = nil, path: nil, enabled: true, command: nil,
         **options, &block)
  select_pager(enabled: enabled, command: command).
    page(text, path: path, enabled: enabled, command: command,
         **options, &block)
end