Sha256: 3558df97f69bd06982b8ce9fef9aac3bec363fde30efdc51e327a05b1585eb6d

Contents?: true

Size: 601 Bytes

Versions: 4

Compression:

Stored size: 601 Bytes

Contents

require '3llo/commands/board/list'
require '3llo/commands/board/select'
require '3llo/commands/board/invalid'

module Tr3llo
  class BoardCommandFactory
    def initialize(subcommand, args)
      @subcommand = subcommand
      @args = args
    end

    def factory
      case subcommand.to_sym
      when :list
        user_id = $container.resolve(:user)[:id]
        Command::Board::ListCommand.new(user_id)
      when :select
        Command::Board::SelectCommand.new
      else
        Command::Board::InvalidCommand.new
      end
    end

    private

    attr_reader :subcommand, :args
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
3llo-0.1.11 lib/3llo/board_command_factory.rb
3llo-0.1.10 lib/3llo/board_command_factory.rb
3llo-0.1.9 lib/3llo/board_command_factory.rb
3llo-0.1.9.beta lib/3llo/board_command_factory.rb