Module: RfcReader::Terminal

Defined in:
lib/rfc_reader/terminal.rb

Class Method Summary collapse

Class Method Details

.choose(message, choices) {|String| ... } ⇒ Object

Parameters:

  • prompt (String)
  • choices (Array<String>)

    where all choices are unique

Yields:

  • (String)

    yields until the user exits the prompt gracefully



14
15
16
17
18
# File 'lib/rfc_reader/terminal.rb', line 14

def self.choose(message, choices)
  while (choice = selector.select(message, choices))
    yield choice
  end
end

.page(content) ⇒ Object

Parameters:

  • content (String)


6
7
8
9
# File 'lib/rfc_reader/terminal.rb', line 6

def self.page(content)
  require "tty-pager"
  TTY::Pager.page(content)
end