Class: Shogun::Command
- Inherits:
-
Object
- Object
- Shogun::Command
- Defined in:
- lib/shogun/command.rb,
lib/shogun/command/new.rb,
lib/shogun/command/database.rb,
lib/shogun/command/generate.rb
Defined Under Namespace
Classes: Database, Generate, New
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(namespace, command, *parameters) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(namespace, command, *parameters) ⇒ Command
Returns a new instance of Command.
17 18 19 20 21 |
# File 'lib/shogun/command.rb', line 17 def initialize(namespace, command, *parameters) @namespace = namespace @command = command @parameters = parameters end |
Instance Method Details
#execute ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/shogun/command.rb', line 23 def execute case @command when "new" then ::Shogun::Command::New.new(@namespace, *@parameters) when "generate" then ::Shogun::Command::Generate.new(@namespace, *@parameters) when "database" then ::Shogun::Command::Database.new(@namespace, *@parameters) when "console" then binding.pry end.execute end |