Class: EloBrain::Players::Player

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/elo_brain/players/player.rb

Class Method Summary collapse

Class Method Details

.from(elo:, nb_matches:, situation:) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/elo_brain/players/player.rb', line 10

def self.from(elo:, nb_matches:, situation:)
  new(
    elo: elo,
    nb_matches: nb_matches,
    situation: situation
  )
end

.from_contract(contract:) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/elo_brain/players/player.rb', line 18

def self.from_contract(contract:)
  new(
    elo: contract[:elo],
    nb_matches: contract[:nb_matches],
    situation: contract[:situation]
  )
end