lib/3llo/card_command_factory.rb in 3llo-0.1.8 vs lib/3llo/card_command_factory.rb in 3llo-0.1.9.beta

- old
+ new

@@ -2,10 +2,12 @@ require '3llo/commands/card/list_mine' require '3llo/commands/card/show' require '3llo/commands/card/move' require '3llo/commands/card/self_assign' require '3llo/commands/card/invalid' +require '3llo/commands/card/comments' +require '3llo/commands/card/add' module Tr3llo class CardCommandFactory def initialize(subcommand, args) @subcommand = subcommand @@ -22,16 +24,22 @@ user_id = $container.resolve(:user)[:id] Command::Card::ListMineCommand.new(board_id, user_id) else Command::Card::ListCommand.new(board_id) end + when 'add' + board_id = $container.resolve(:board)[:id] + Command::Card::AddCommand.new(board_id) when 'show' card_id, _ = args Command::Card::ShowCommand.new(card_id) + when 'comments' + card_id, _ = args + Command::Card::CommentsCommand.new(card_id) when 'move' - card_id, list_id = args + card_id, _ = args board_id = $container.resolve(:board)[:id] - Command::Card::MoveCommand.new(card_id, list_id, board_id) + Command::Card::MoveCommand.new(card_id, board_id) when 'self-assign' card_id, _ = args user_id = $container.resolve(:user)[:id] Command::Card::SelfAssignCommand.new(card_id, user_id) else