Class: Vaulty::CLI::Command
- Inherits:
-
Object
- Object
- Vaulty::CLI::Command
- Defined in:
- lib/vaulty/cli/command.rb
Class Method Summary collapse
-
.call(*args) ⇒ Object
Initializes a new command with the args and calls it.
Instance Method Summary collapse
-
#banner(msg, color: :green) ⇒ Object
Render a banner.
-
#call ⇒ Object
Interface method should be defined by subclasses.
-
#prompt ⇒ TTY::Prompt
Returns an instance of TTY::Prompt.
-
#table(data, highlight: {}) ⇒ Object
Renders a table.
Class Method Details
.call(*args) ⇒ Object
Initializes a new command with the args and calls it
33 34 35 |
# File 'lib/vaulty/cli/command.rb', line 33 def self.call(*args) new(*args).call end |
Instance Method Details
#banner(msg, color: :green) ⇒ Object
Render a banner
16 17 18 |
# File 'lib/vaulty/cli/command.rb', line 16 def (msg, color: :green) Vaulty::Output::Banner.render(msg, color: color, prompt: prompt) end |
#call ⇒ Object
Interface method should be defined by subclasses
7 8 9 |
# File 'lib/vaulty/cli/command.rb', line 7 def call raise NotImplementedError, "#{inspect}.call is not implemented" end |