Sha256: 475c1bfdb733bd83381631bb87bd1fb080ebad0111ec8ad1e9064c7ad9db22c6

Contents?: true

Size: 656 Bytes

Versions: 2

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true

module Basketball
  module Draft
    # Describes what all Room events have to have to be considered an "event".
    class Event < Entity
      attr_reader :pick, :round, :round_pick, :front_office

      def initialize(front_office:, pick:, round:, round_pick:)
        super()

        raise ArgumentError, 'front_office required' unless front_office

        @front_office = front_office
        @pick         = pick.to_i
        @round        = round.to_i
        @round_pick   = round_pick.to_i
      end

      def to_s
        "[#{id}] ##{pick} R:#{round} P:#{round_pick} - #{front_office}"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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