Sha256: c4f5d166f92e8e82639edf8bb85aac6ff9f544f2b36660ea47325e21f639f4f2

Contents?: true

Size: 528 Bytes

Versions: 9

Compression:

Stored size: 528 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(id:, front_office:, player:, round:, round_pick:, auto: false)
        super(id:, front_office:, 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

9 entries across 9 versions & 1 rubygems

Version Path
basketball-0.0.27 lib/basketball/draft/pick.rb
basketball-0.0.26 lib/basketball/draft/pick.rb
basketball-0.0.25 lib/basketball/draft/pick.rb
basketball-0.0.24 lib/basketball/draft/pick.rb
basketball-0.0.23 lib/basketball/draft/pick.rb
basketball-0.0.22 lib/basketball/draft/pick.rb
basketball-0.0.21 lib/basketball/draft/pick.rb
basketball-0.0.20 lib/basketball/draft/pick.rb
basketball-0.0.19 lib/basketball/draft/pick.rb