Class: Bosh::Cli::Terminal
- Extended by:
- Forwardable
- Defined in:
- lib/cli/terminal.rb
Instance Method Summary collapse
- #ask(prompt) ⇒ Object
- #ask_password(prompt) ⇒ Object
-
#initialize(highline, sayer) ⇒ Terminal
constructor
A new instance of Terminal.
- #say_green(message) ⇒ Object
- #say_red(message) ⇒ Object
Constructor Details
#initialize(highline, sayer) ⇒ Terminal
Returns a new instance of Terminal.
6 7 8 9 |
# File 'lib/cli/terminal.rb', line 6 def initialize(highline, sayer) @highline = highline @sayer = sayer end |
Instance Method Details
#ask(prompt) ⇒ Object
11 12 13 |
# File 'lib/cli/terminal.rb', line 11 def ask(prompt) highline.ask(prompt).to_s # make sure we return a String not a HighLine::String end |
#ask_password(prompt) ⇒ Object
15 16 17 |
# File 'lib/cli/terminal.rb', line 15 def ask_password(prompt) highline.ask(prompt) { |q| q.echo = false }.to_s end |
#say_green(message) ⇒ Object
19 20 21 |
# File 'lib/cli/terminal.rb', line 19 def say_green() sayer.say(.make_green) end |
#say_red(message) ⇒ Object
23 24 25 |
# File 'lib/cli/terminal.rb', line 23 def say_red() sayer.say(.make_red) end |