Class: Ansi::Selector::Impl
- Inherits:
-
Object
- Object
- Ansi::Selector::Impl
- Defined in:
- lib/ansi/selector/impl.rb
Direct Known Subclasses
Constant Summary collapse
- CODES =
{ standout_mode: `tput rev`, exit_standout_mode: `tput rmso`, cursor_up: `tput cuu1`, cursor_down: `tput cud1`, carriage_return_key: `tput cr` }
Instance Method Summary collapse
-
#initialize(options) ⇒ Impl
constructor
A new instance of Impl.
- #select ⇒ Object
Constructor Details
#initialize(options) ⇒ Impl
Returns a new instance of Impl.
14 15 16 17 18 19 |
# File 'lib/ansi/selector/impl.rb', line 14 def initialize() @options = @highlighted_line_index = 0 @cursor_line_index = 0 end |
Instance Method Details
#select ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/ansi/selector/impl.rb', line 21 def select answer = ask_to_choose go_to_line(@options.size) answer ensure tty.close end |