basketball 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afad5b6023e9b0baf1dc11fe6874d4cc46430c1698aa4e97bf5dc2df8cbb314e
4
- data.tar.gz: f98bb161b770d7148c4fb271ab1b58b2347cfe7b85f94acf1fb6332a4517e61b
3
+ metadata.gz: cd49f58b9f207574c1d2d24dfbfbcc95aa19aa1b20dfef193e7ed5f76dc9c40b
4
+ data.tar.gz: 27b5646e17b6e4e195938b6df2c5aa72afa5cd8d83c19abe9cbbe52d603b6399
5
5
  SHA512:
6
- metadata.gz: 439ca00c393c39e8535ffc21b504b66aaf2a987f09e424ba55b8d4d33d740c6ece187e8e2821239b1d2fa7512aa3743e8a8750be9c41d71259a6093eb2bff57a
7
- data.tar.gz: 433fbfeaf16e28312b165ff2b293b9a529ea57e95f0e03e4637b730f1dc36c22c095717825da54da6e0549eeccbeedbb999caf7db5afed80e8e439b25a15d2cd
6
+ metadata.gz: '09133208c27fa5edf1667a669178703ce702a3b9f20a2d0bb5006dc4ba3260b9b9ccd51db7bbc53cf61d2df12806fd0241ca6cb8ede153ca3af2782c30eeddf9'
7
+ data.tar.gz: 1e82cd3b7057c8e2ce63a1df77a4ecd4ea7ab8c64275db9d70c1e40d2f006b9b1e128d2a92311b3f3c3f99e35d5507f81ad8c5faec385906814ea53d32ce6583
@@ -4,21 +4,20 @@ module Basketball
4
4
  module Draft
5
5
  # Describes what all Room events have to have to be considered an "event".
6
6
  class Event < Entity
7
- attr_reader :pick, :round, :round_pick, :front_office
7
+ attr_reader :round, :round_pick, :front_office
8
8
 
9
- def initialize(front_office:, pick:, round:, round_pick:)
10
- super()
9
+ def initialize(id:, front_office:, round:, round_pick:)
10
+ super(id)
11
11
 
12
12
  raise ArgumentError, 'front_office required' unless front_office
13
13
 
14
14
  @front_office = front_office
15
- @pick = pick.to_i
16
15
  @round = round.to_i
17
16
  @round_pick = round_pick.to_i
18
17
  end
19
18
 
20
19
  def to_s
21
- "[#{id}] ##{pick} R:#{round} P:#{round_pick} - #{front_office}"
20
+ "[#{id}] R:#{round} P:#{round_pick} - #{front_office}"
22
21
  end
23
22
  end
24
23
  end
@@ -6,8 +6,8 @@ module Basketball
6
6
  class Pick < Event
7
7
  attr_reader :player, :auto
8
8
 
9
- def initialize(front_office:, player:, pick:, round:, round_pick:, auto: false)
10
- super(front_office:, pick:, round:, round_pick:)
9
+ def initialize(id:, front_office:, player:, round:, round_pick:, auto: false)
10
+ super(id:, front_office:, round:, round_pick:)
11
11
 
12
12
  raise ArgumentError, 'player required' unless player
13
13
 
@@ -148,7 +148,7 @@ module Basketball
148
148
  def skip!
149
149
  return if done?
150
150
 
151
- event = Skip.new(front_office:, pick:, round:, round_pick:)
151
+ event = Skip.new(id: pick, front_office:, round:, round_pick:)
152
152
 
153
153
  add_event!(event)
154
154
 
@@ -159,7 +159,7 @@ module Basketball
159
159
  return if done?
160
160
 
161
161
  player = front_office.pick(assessment)
162
- event = Pick.new(front_office:, pick:, round:, round_pick:, player:, auto: true)
162
+ event = Pick.new(id: pick, front_office:, round:, round_pick:, player:, auto: true)
163
163
 
164
164
  add_event!(event)
165
165
 
@@ -183,7 +183,7 @@ module Basketball
183
183
  def pick!(player)
184
184
  return nil if done?
185
185
 
186
- event = Pick.new(front_office:, pick:, round:, round_pick:, player:)
186
+ event = Pick.new(id: pick, front_office:, round:, round_pick:, player:)
187
187
 
188
188
  add_event!(event)
189
189
  end
@@ -199,7 +199,7 @@ module Basketball
199
199
  raise EndOfDraftError, "#{total_picks} pick limit reached" if done?
200
200
  raise UnknownFrontOfficeError, "#{front_office} doesnt exist" unless front_offices.include?(event.front_office)
201
201
  raise EventOutOfOrderError, "#{event.front_office} cant pick right now" if event.front_office != front_office
202
- raise EventOutOfOrderError, "#{event} has wrong pick" if event.pick != pick
202
+ raise EventOutOfOrderError, "#{event} has wrong pick" if event.id != pick
203
203
  raise EventOutOfOrderError, "#{event} has wrong round" if event.round != round
204
204
  raise EventOutOfOrderError, "#{event} has wrong round_pick" if event.round_pick != round_pick
205
205
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Basketball
4
- VERSION = '0.0.18'
4
+ VERSION = '0.0.19'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basketball
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio