Class: Neetob::CLI::UI

Inherits:
Object
  • Object
show all
Defined in:
lib/neetob/cli/ui.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUI

Returns a new instance of UI.



12
13
14
# File 'lib/neetob/cli/ui.rb', line 12

def initialize
  @shell = Thor::Base.shell.new
end

Instance Attribute Details

#shellObject

Returns the value of attribute shell.



10
11
12
# File 'lib/neetob/cli/ui.rb', line 10

def shell
  @shell
end

Instance Method Details

#ask(question, echo = true) ⇒ Object



20
21
22
# File 'lib/neetob/cli/ui.rb', line 20

def ask(question, echo = true)
  shell.ask(question, echo:)
end

#error(statement) ⇒ Object



28
29
30
# File 'lib/neetob/cli/ui.rb', line 28

def error(statement)
  shell.say(statement, Thor::Shell::Color::RED)
end

#info(statement) ⇒ Object



36
37
38
# File 'lib/neetob/cli/ui.rb', line 36

def info(statement)
  shell.say(statement)
end

#say(statement, color = Thor::Shell::Color::YELLOW) ⇒ Object



16
17
18
# File 'lib/neetob/cli/ui.rb', line 16

def say(statement, color = Thor::Shell::Color::YELLOW)
  shell.say(statement, color)
end

#success(statement) ⇒ Object



32
33
34
# File 'lib/neetob/cli/ui.rb', line 32

def success(statement)
  shell.say(statement, Thor::Shell::Color::GREEN)
end

#yes?(question) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/neetob/cli/ui.rb', line 24

def yes?(question)
  shell.yes?(question)
end