Class: Tr3llo::ListCommandFactory
- Inherits:
-
Object
- Object
- Tr3llo::ListCommandFactory
- Defined in:
- lib/3llo/list_command_factory.rb
Instance Method Summary collapse
- #factory ⇒ Object
-
#initialize(subcommand, args) ⇒ ListCommandFactory
constructor
A new instance of ListCommandFactory.
Constructor Details
#initialize(subcommand, args) ⇒ ListCommandFactory
Returns a new instance of ListCommandFactory.
7 8 9 10 |
# File 'lib/3llo/list_command_factory.rb', line 7 def initialize(subcommand, args) @subcommand = subcommand @args = args end |
Instance Method Details
#factory ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/3llo/list_command_factory.rb', line 12 def factory case subcommand.to_sym when :list board_id = $container.resolve(:board)[:id] Command::List::ListCommand.new(board_id) when :cards list_id, _ = args Command::List::CardsCommand.new(list_id) else Command::List::InvalidCommand.new end end |