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) ⇒ Terminal
constructor
A new instance of Terminal.
- #say_green(message) ⇒ Object
- #say_red(message) ⇒ Object
Constructor Details
#initialize(highline) ⇒ Terminal
Returns a new instance of Terminal.
6 7 8 |
# File 'lib/cli/terminal.rb', line 6 def initialize(highline) @highline = highline end |
Instance Method Details
#ask(prompt) ⇒ Object
10 11 12 |
# File 'lib/cli/terminal.rb', line 10 def ask(prompt) highline.ask(prompt).to_s # make sure we return a String not a HighLine::String end |
#ask_password(prompt) ⇒ Object
14 15 16 |
# File 'lib/cli/terminal.rb', line 14 def ask_password(prompt) highline.ask(prompt) { |q| q.echo = false }.to_s end |
#say_green(message) ⇒ Object
18 19 20 |
# File 'lib/cli/terminal.rb', line 18 def say_green() highline.say(.make_green) end |
#say_red(message) ⇒ Object
22 23 24 |
# File 'lib/cli/terminal.rb', line 22 def say_red() highline.say(.make_red) end |