Class: ReplayedTTYMethods::ReplayedPrompt

Inherits:
TTY::Prompt
  • Object
show all
Defined in:
lib/clir/TTY-Prompt.cls.rb

Constant Summary collapse

CODE_SUPER_OR_GET_INPUT =
<<~RUBY
if %{truth}
  CLI::Replayer.get_input
else
  super.tap do |result|
    CLI::Replayer.add_input(result)
  end
end
RUBY

Instance Method Summary collapse

Instance Method Details

#code_super(on) ⇒ Object

off) or to get input (if replayer is on)

Returns:

  • method code to evaluate super (if replayer is



124
125
126
# File 'lib/clir/TTY-Prompt.cls.rb', line 124

def code_super(on)
  CODE_SUPER_OR_GET_INPUT % {truth: on ? 'true' : 'false'}
end