Class: TTY::Prompt
- Inherits:
-
Object
- Object
- TTY::Prompt
- Defined in:
- lib/monkey_patches/tty/prompt.rb
Instance Method Summary collapse
- #clear_list ⇒ Object
-
#invoke_select(object, question, *args, &block) ⇒ Object
FIXME This introduces dependencies to tty-prompt v0.23.1 original - github.com/piotrmurach/tty-prompt/blob/master/lib/tty/prompt.rb#L226-L250.
- #unsubscribe_list ⇒ Object
Instance Method Details
#clear_list ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/monkey_patches/tty/prompt.rb', line 30 def clear_list @done = true # @list = nil unsubscribe_list # 2 is for the prompt message print(TTY::Cursor.clear_lines(GitPrompt::SELECT_OPTIONS_PER_PAGE + 2, :up)) end |
#invoke_select(object, question, *args, &block) ⇒ Object
FIXME This introduces dependencies to tty-prompt v0.23.1 original - github.com/piotrmurach/tty-prompt/blob/master/lib/tty/prompt.rb#L226-L250
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/monkey_patches/tty/prompt.rb', line 10 def invoke_select(object, question, *args, &block) = Utils.(args) choices = if args.empty? && !block possible = .dup = {} possible elsif args.size == 1 && args[0].is_a?(Hash) Utils.(args) else args.flatten end @list = object.new(self, **) @list.(question, choices, &block) end |
#unsubscribe_list ⇒ Object
26 27 28 |
# File 'lib/monkey_patches/tty/prompt.rb', line 26 def unsubscribe_list self.unsubscribe(@list) end |