Class: Basketball::Season::Opponent

Inherits:
Entity
  • Object
show all
Defined in:
lib/basketball/season/opponent.rb

Overview

Represents a team without a roster. Equal to a team by identity. A team’s roster will not be known until the last minute (when it is game time).

Instance Attribute Summary

Attributes inherited from Entity

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#<=>, #==, #comparable_id, #hash, #to_s

Constructor Details

#initialize(id:) ⇒ Opponent

Returns a new instance of Opponent.



14
15
16
17
18
# File 'lib/basketball/season/opponent.rb', line 14

def initialize(id:)
  super(id)

  freeze
end

Class Method Details

.from(team) ⇒ Object



9
10
11
# File 'lib/basketball/season/opponent.rb', line 9

def from(team)
  new(id: team.id)
end