Class: ActiveGenie::Ranker::FreeForAll
- Inherits:
-
Object
- Object
- ActiveGenie::Ranker::FreeForAll
- Defined in:
- lib/active_genie/ranker/free_for_all.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(players, criteria, config: nil) ⇒ FreeForAll
constructor
A new instance of FreeForAll.
Constructor Details
#initialize(players, criteria, config: nil) ⇒ FreeForAll
Returns a new instance of FreeForAll.
10 11 12 13 14 15 16 |
# File 'lib/active_genie/ranker/free_for_all.rb', line 10 def initialize(players, criteria, config: nil) @players = Entities::Players.new(players) @criteria = criteria @initial_config = config @start_time = Time.now @total_tokens = 0 end |
Class Method Details
.call ⇒ Object
6 7 8 |
# File 'lib/active_genie/ranker/free_for_all.rb', line 6 def self.call(...) new(...).call end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/active_genie/ranker/free_for_all.rb', line 18 def call ActiveGenie::FiberByBatch.call(matches, config:) do |player_a, player_b| winner, loser = debate(player_a, player_b) update_players_score(winner, loser) end build_result end |