Class: Minitar::CLI::Command
- Inherits:
-
Object
- Object
- Minitar::CLI::Command
- Defined in:
- lib/minitar/cli/command.rb
Overview
The base for commands in Minitar::CLI. This will be replaced in a future version by one of the better-executed CLI application frameworks like GLI, after Ruby 1.8 and 1.9 support have been dropped.
Defined Under Namespace
Modules: CatchMinitarErrors
Class Attribute Summary collapse
-
.children ⇒ Object
readonly
Returns the value of attribute children.
Instance Attribute Summary collapse
-
#commander ⇒ Object
readonly
Returns the value of attribute commander.
-
#ioe ⇒ Object
readonly
Returns the value of attribute ioe.
Class Method Summary collapse
Instance Method Summary collapse
- #call(_args, _opts = {}) ⇒ Object (also: #[])
- #help ⇒ Object
-
#initialize(commander) ⇒ Command
constructor
A new instance of Command.
- #name ⇒ Object
Constructor Details
#initialize(commander) ⇒ Command
Returns a new instance of Command.
29 30 31 32 |
# File 'lib/minitar/cli/command.rb', line 29 def initialize(commander) @commander = commander @ioe = commander.ioe end |
Class Attribute Details
.children ⇒ Object (readonly)
Returns the value of attribute children.
13 14 15 |
# File 'lib/minitar/cli/command.rb', line 13 def children @children end |
Instance Attribute Details
#commander ⇒ Object (readonly)
Returns the value of attribute commander.
9 10 11 |
# File 'lib/minitar/cli/command.rb', line 9 def commander @commander end |
#ioe ⇒ Object (readonly)
Returns the value of attribute ioe.
10 11 12 |
# File 'lib/minitar/cli/command.rb', line 10 def ioe @ioe end |
Class Method Details
.inherited(subclass) ⇒ Object
15 16 17 |
# File 'lib/minitar/cli/command.rb', line 15 def inherited(subclass) children << subclass end |
Instance Method Details
#call(_args, _opts = {}) ⇒ Object Also known as: []
38 39 40 |
# File 'lib/minitar/cli/command.rb', line 38 def call(_args, _opts = {}) raise Minitar::CLI::AbstractCommandError end |
#help ⇒ Object
43 44 45 |
# File 'lib/minitar/cli/command.rb', line 43 def help raise Minitar::CLI::AbstractCommandError end |
#name ⇒ Object
34 35 36 |
# File 'lib/minitar/cli/command.rb', line 34 def name raise Minitar::CLI::AbstractCommandError end |