Class: Vito::CommandLine::String
- Inherits:
-
Object
- Object
- Vito::CommandLine::String
- Defined in:
- lib/vito/command_line/string.rb
Instance Method Summary collapse
-
#command ⇒ Object
Command is the first part of the command string, if any given:.
-
#initialize(argv) ⇒ String
constructor
A new instance of String.
-
#options ⇒ Object
Options are anything that comes after dashes in the command line:.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ String
Returns a new instance of String.
4 5 6 |
# File 'lib/vito/command_line/string.rb', line 4 def initialize(argv) @argv = argv end |
Instance Method Details
#command ⇒ Object
Command is the first part of the command string, if any given:
vito commands
In this case, it’ll run the ‘commands` command.
26 27 28 |
# File 'lib/vito/command_line/string.rb', line 26 def command Vito::CommandLine::Command.new(self).command end |
#options ⇒ Object
Options are anything that comes after dashes in the command line:
-f filename
--file filename
17 18 19 |
# File 'lib/vito/command_line/string.rb', line 17 def Vito::CommandLine::Options.new(argv) end |
#run ⇒ Object
8 9 10 |
# File 'lib/vito/command_line/string.rb', line 8 def run "Vito::Commands::#{command.camelize}".constantize.new(self).perform end |