Sha256: b6a4cde8f1f69fd4b9cd94e55ffa34c9103cce2380da7165cbe5727fda7f5c64

Contents?: true

Size: 549 Bytes

Versions: 6

Compression:

Stored size: 549 Bytes

Contents

# frozen_string_literal: true

module Basketball
  module Draft
    # Room event where a player is selected.
    class Pick < Event
      value_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

        freeze
      end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
basketball-0.0.16 lib/basketball/draft/pick.rb
basketball-0.0.15 lib/basketball/draft/pick.rb
basketball-0.0.14 lib/basketball/draft/pick.rb
basketball-0.0.13 lib/basketball/draft/pick.rb
basketball-0.0.12 lib/basketball/draft/pick.rb
basketball-0.0.11 lib/basketball/draft/pick.rb