Sha256: 24dd21e6032039ef7ae334ea4078c7b93b37f8e5d55a7928b276e30de9eefed2

Contents?: true

Size: 532 Bytes

Versions: 2

Compression:

Stored size: 532 Bytes

Contents

# frozen_string_literal: true

module Basketball
  module Draft
    # Room event where a player is selected.
    class Pick < Event
      attr_reader :player, :auto

      def initialize(front_office:, player:, pick:, round:, round_pick:, auto: false)
        super(front_office:, pick:, round:, round_pick:)

        raise ArgumentError, 'player required' unless player

        @player = player
        @auto   = auto
      end

      def to_s
        "#{super} #{auto ? 'auto-' : ''}picked #{player}"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
basketball-0.0.18 lib/basketball/draft/pick.rb
basketball-0.0.17 lib/basketball/draft/pick.rb