Method: Skunk::CommandFactory.command_class
- Defined in:
- lib/skunk/command_factory.rb
.command_class(mode) ⇒ Class
Returns the command class based on the command that was executed
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/skunk/command_factory.rb', line 14 def self.command_class(mode) mode = mode.to_s.split("_").first.to_sym if COMMAND_CLASS_MODES.include? mode require "skunk/commands/#{mode}" Command.const_get(mode.capitalize) else require "skunk/commands/default" Command::Default end end |