Class: Bosh::Cli::Terminal

Inherits:
Object show all
Extended by:
Forwardable
Defined in:
lib/cli/terminal.rb

Instance Method Summary collapse

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(message)
  highline.say(message.make_green)
end

#say_red(message) ⇒ Object



22
23
24
# File 'lib/cli/terminal.rb', line 22

def say_red(message)
  highline.say(message.make_red)
end