active_genie 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +35 -50
- data/VERSION +1 -1
- data/lib/active_genie/battle/README.md +5 -5
- data/lib/active_genie/battle/generalist.rb +132 -0
- data/lib/active_genie/battle.rb +6 -5
- data/lib/active_genie/clients/providers/anthropic_client.rb +77 -0
- data/lib/active_genie/clients/{base_client.rb → providers/base_client.rb} +74 -100
- data/lib/active_genie/clients/providers/deepseek_client.rb +91 -0
- data/lib/active_genie/clients/providers/google_client.rb +132 -0
- data/lib/active_genie/clients/providers/openai_client.rb +96 -0
- data/lib/active_genie/clients/unified_client.rb +42 -12
- data/lib/active_genie/concerns/loggable.rb +11 -23
- data/lib/active_genie/config/battle_config.rb +8 -0
- data/lib/active_genie/config/data_extractor_config.rb +23 -0
- data/lib/active_genie/config/llm_config.rb +36 -0
- data/lib/active_genie/config/log_config.rb +44 -0
- data/lib/active_genie/config/providers/anthropic_config.rb +57 -0
- data/lib/active_genie/config/providers/deepseek_config.rb +50 -0
- data/lib/active_genie/config/providers/google_config.rb +52 -0
- data/lib/active_genie/config/providers/openai_config.rb +50 -0
- data/lib/active_genie/config/providers/provider_base.rb +89 -0
- data/lib/active_genie/config/providers_config.rb +62 -0
- data/lib/active_genie/config/ranking_config.rb +21 -0
- data/lib/active_genie/config/scoring_config.rb +8 -0
- data/lib/active_genie/configuration.rb +51 -28
- data/lib/active_genie/data_extractor/README.md +13 -13
- data/lib/active_genie/data_extractor/from_informal.rb +54 -48
- data/lib/active_genie/data_extractor/generalist.md +12 -0
- data/lib/active_genie/data_extractor/generalist.rb +125 -0
- data/lib/active_genie/data_extractor.rb +7 -5
- data/lib/active_genie/errors/invalid_provider_error.rb +41 -0
- data/lib/active_genie/logger.rb +17 -66
- data/lib/active_genie/ranking/README.md +31 -1
- data/lib/active_genie/ranking/elo_round.rb +107 -104
- data/lib/active_genie/ranking/free_for_all.rb +78 -74
- data/lib/active_genie/ranking/player.rb +79 -71
- data/lib/active_genie/ranking/players_collection.rb +83 -71
- data/lib/active_genie/ranking/ranking.rb +71 -94
- data/lib/active_genie/ranking/ranking_scoring.rb +71 -50
- data/lib/active_genie/ranking.rb +2 -0
- data/lib/active_genie/scoring/README.md +4 -4
- data/lib/active_genie/scoring/generalist.rb +171 -0
- data/lib/active_genie/scoring/recommended_reviewers.rb +70 -71
- data/lib/active_genie/scoring.rb +8 -5
- data/lib/active_genie.rb +23 -1
- data/lib/tasks/benchmark.rake +10 -9
- data/lib/tasks/install.rake +3 -1
- data/lib/tasks/templates/active_genie.rb +11 -6
- metadata +31 -22
- data/lib/active_genie/battle/basic.rb +0 -129
- data/lib/active_genie/clients/anthropic_client.rb +0 -84
- data/lib/active_genie/clients/google_client.rb +0 -135
- data/lib/active_genie/clients/helpers/retry.rb +0 -29
- data/lib/active_genie/clients/openai_client.rb +0 -98
- data/lib/active_genie/configuration/log_config.rb +0 -14
- data/lib/active_genie/configuration/providers/anthropic_config.rb +0 -54
- data/lib/active_genie/configuration/providers/base_config.rb +0 -85
- data/lib/active_genie/configuration/providers/deepseek_config.rb +0 -54
- data/lib/active_genie/configuration/providers/google_config.rb +0 -56
- data/lib/active_genie/configuration/providers/internal_company_api_config.rb +0 -54
- data/lib/active_genie/configuration/providers/openai_config.rb +0 -54
- data/lib/active_genie/configuration/providers_config.rb +0 -40
- data/lib/active_genie/configuration/runtime_config.rb +0 -35
- data/lib/active_genie/data_extractor/basic.rb +0 -101
- data/lib/active_genie/scoring/basic.rb +0 -170
@@ -1,134 +1,137 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
class EloRound
|
5
|
-
def self.call(...)
|
6
|
-
new(...).call
|
7
|
-
end
|
3
|
+
require_relative '../battle/generalist'
|
8
4
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
@tmp_defenders = []
|
16
|
-
@start_time = Time.now
|
17
|
-
@total_tokens = 0
|
18
|
-
@previous_elo = {}
|
19
|
-
@previous_highest_elo = @defender_tier.max_by(&:elo).elo
|
20
|
-
end
|
5
|
+
module ActiveGenie
|
6
|
+
module Ranking
|
7
|
+
class EloRound
|
8
|
+
def self.call(...)
|
9
|
+
new(...).call
|
10
|
+
end
|
21
11
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
12
|
+
def initialize(players, criteria, config: {})
|
13
|
+
@players = players
|
14
|
+
@relegation_tier = players.calc_relegation_tier
|
15
|
+
@defender_tier = players.calc_defender_tier
|
16
|
+
@criteria = criteria
|
17
|
+
@config = config
|
18
|
+
@tmp_defenders = []
|
19
|
+
@start_time = Time.now
|
20
|
+
@total_tokens = 0
|
21
|
+
@previous_elo = {}
|
22
|
+
@previous_highest_elo = @defender_tier.max_by(&:elo).elo
|
23
|
+
end
|
29
24
|
|
30
|
-
|
31
|
-
|
25
|
+
def call
|
26
|
+
ActiveGenie::Logger.with_context(log_context) do
|
27
|
+
save_previous_elo
|
28
|
+
matches.each do |player_1, player_2|
|
29
|
+
# TODO: battle can take a while, can be parallelized
|
30
|
+
winner, loser = battle(player_1, player_2)
|
31
|
+
next if winner.nil? || loser.nil?
|
32
|
+
|
33
|
+
winner.elo = calculate_new_elo(winner.elo, loser.elo, 1)
|
34
|
+
loser.elo = calculate_new_elo(loser.elo, winner.elo, 0)
|
35
|
+
end
|
32
36
|
end
|
33
|
-
end
|
34
37
|
|
35
|
-
|
38
|
+
ActiveGenie::Logger.call({ code: :elo_round_report, **report })
|
36
39
|
|
37
|
-
|
38
|
-
|
40
|
+
report
|
41
|
+
end
|
39
42
|
|
40
|
-
|
43
|
+
private
|
41
44
|
|
42
|
-
|
43
|
-
|
45
|
+
BATTLE_PER_PLAYER = 3
|
46
|
+
K = 32
|
44
47
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
+
def save_previous_elo
|
49
|
+
@previous_elo = @players.map { |player| [player.id, player.elo] }.to_h
|
50
|
+
end
|
48
51
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
52
|
+
def matches
|
53
|
+
@relegation_tier.each_with_object([]) do |attack_player, matches|
|
54
|
+
BATTLE_PER_PLAYER.times do
|
55
|
+
matches << [attack_player, next_defense_player].shuffle
|
56
|
+
end
|
53
57
|
end
|
54
|
-
matches
|
55
58
|
end
|
56
|
-
end
|
57
59
|
|
58
|
-
|
59
|
-
|
60
|
+
def next_defense_player
|
61
|
+
@tmp_defenders = @defender_tier.shuffle if @tmp_defenders.empty?
|
60
62
|
|
61
|
-
|
62
|
-
|
63
|
+
@tmp_defenders.pop
|
64
|
+
end
|
63
65
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
66
|
+
def battle(player_1, player_2)
|
67
|
+
ActiveGenie::Logger.with_context({ player_1_id: player_1.id, player_2_id: player_2.id }) do
|
68
|
+
result = ActiveGenie::Battle.call(
|
69
|
+
player_1.content,
|
70
|
+
player_2.content,
|
71
|
+
@criteria,
|
72
|
+
config: @config
|
73
|
+
)
|
74
|
+
|
75
|
+
winner, loser = case result['winner']
|
76
|
+
when 'player_1' then [player_1, player_2]
|
77
|
+
when 'player_2' then [player_2, player_1]
|
78
|
+
when 'draw' then [nil, nil]
|
79
|
+
end
|
80
|
+
|
81
|
+
[winner, loser]
|
77
82
|
end
|
78
|
-
|
79
|
-
[winner, loser]
|
80
83
|
end
|
81
|
-
end
|
82
84
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
player_rating + (K * (score - expected_score)).round
|
88
|
-
end
|
85
|
+
# INFO: Read more about the Elo rating system on https://en.wikipedia.org/wiki/Elo_rating_system
|
86
|
+
def calculate_new_elo(player_rating, opponent_rating, score)
|
87
|
+
expected_score = 1.0 / (1.0 + 10.0**((opponent_rating - player_rating) / 400.0))
|
89
88
|
|
90
|
-
|
91
|
-
|
92
|
-
end
|
89
|
+
player_rating + (K * (score - expected_score)).round
|
90
|
+
end
|
93
91
|
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
def log_context
|
93
|
+
{ elo_round_id: }
|
94
|
+
end
|
97
95
|
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
def elo_round_id
|
97
|
+
relegation_tier_ids = @relegation_tier.map(&:id).join(',')
|
98
|
+
defender_tier_ids = @defender_tier.map(&:id).join(',')
|
101
99
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
players_in_round: players_in_round.map(&:id),
|
106
|
-
battles_count: matches.size,
|
107
|
-
duration_seconds: Time.now - @start_time,
|
108
|
-
total_tokens: @total_tokens,
|
109
|
-
previous_highest_elo: @previous_highest_elo,
|
110
|
-
highest_elo:,
|
111
|
-
highest_elo_diff: highest_elo - @previous_highest_elo,
|
112
|
-
players_elo_diff:,
|
113
|
-
}
|
114
|
-
end
|
100
|
+
ranking_unique_key = [relegation_tier_ids, defender_tier_ids, @criteria, @config.to_json].join('-')
|
101
|
+
Digest::MD5.hexdigest(ranking_unique_key)
|
102
|
+
end
|
115
103
|
|
116
|
-
|
117
|
-
|
118
|
-
|
104
|
+
def report
|
105
|
+
{
|
106
|
+
elo_round_id:,
|
107
|
+
players_in_round: players_in_round.map(&:id),
|
108
|
+
battles_count: matches.size,
|
109
|
+
duration_seconds: Time.now - @start_time,
|
110
|
+
total_tokens: @total_tokens,
|
111
|
+
previous_highest_elo: @previous_highest_elo,
|
112
|
+
highest_elo:,
|
113
|
+
highest_elo_diff: highest_elo - @previous_highest_elo,
|
114
|
+
players_elo_diff:
|
115
|
+
}
|
116
|
+
end
|
119
117
|
|
120
|
-
|
121
|
-
|
122
|
-
|
118
|
+
def players_in_round
|
119
|
+
@defender_tier + @relegation_tier
|
120
|
+
end
|
123
121
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
end.sort_by { |_, diff| -diff }.to_h
|
128
|
-
end
|
122
|
+
def highest_elo
|
123
|
+
players_in_round.max_by(&:elo).elo
|
124
|
+
end
|
129
125
|
|
130
|
-
|
131
|
-
|
126
|
+
def players_elo_diff
|
127
|
+
players_in_round.map do |player|
|
128
|
+
[player.id, player.elo - @previous_elo[player.id]]
|
129
|
+
end.sort_by { |_, diff| -diff }.to_h
|
130
|
+
end
|
131
|
+
|
132
|
+
def log_observer(log)
|
133
|
+
@total_tokens += log[:total_tokens] if log[:code] == :llm_usage
|
134
|
+
end
|
132
135
|
end
|
133
136
|
end
|
134
137
|
end
|
@@ -1,93 +1,97 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
class FreeForAll
|
5
|
-
def self.call(...)
|
6
|
-
new(...).call
|
7
|
-
end
|
3
|
+
require_relative '../battle/generalist'
|
8
4
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
5
|
+
module ActiveGenie
|
6
|
+
module Ranking
|
7
|
+
class FreeForAll
|
8
|
+
def self.call(...)
|
9
|
+
new(...).call
|
10
|
+
end
|
16
11
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
player_1.draw!
|
24
|
-
player_2.draw!
|
25
|
-
else
|
26
|
-
winner.win!
|
27
|
-
loser.lose!
|
28
|
-
end
|
29
|
-
end
|
12
|
+
def initialize(players, criteria, config: {})
|
13
|
+
@players = players
|
14
|
+
@criteria = criteria
|
15
|
+
@config = config
|
16
|
+
@start_time = Time.now
|
17
|
+
@total_tokens = 0
|
30
18
|
end
|
31
19
|
|
32
|
-
|
20
|
+
def call
|
21
|
+
ActiveGenie::Logger.with_context(log_context, observer: method(:log_observer)) do
|
22
|
+
matches.each do |player_1, player_2|
|
23
|
+
winner, loser = battle(player_1, player_2)
|
33
24
|
|
34
|
-
|
35
|
-
|
25
|
+
if winner.nil? || loser.nil?
|
26
|
+
player_1.draw!
|
27
|
+
player_2.draw!
|
28
|
+
else
|
29
|
+
winner.win!
|
30
|
+
loser.lose!
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
36
34
|
|
37
|
-
|
35
|
+
ActiveGenie::Logger.call({ code: :free_for_all_report, **report })
|
38
36
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
37
|
+
report
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
44
41
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
@criteria,
|
50
|
-
config: @config
|
51
|
-
)
|
52
|
-
|
53
|
-
winner, loser = case result['winner']
|
54
|
-
when 'player_1' then [player_1, player_2, result['reasoning']]
|
55
|
-
when 'player_2' then [player_2, player_1, result['reasoning']]
|
56
|
-
when 'draw' then [nil, nil, result['reasoning']]
|
42
|
+
# TODO: reduce the number of matches based on transitivity.
|
43
|
+
# For example, if A is better than B, and B is better than C, then battle between A and C should be auto win A
|
44
|
+
def matches
|
45
|
+
@players.eligible.combination(2).to_a
|
57
46
|
end
|
58
47
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
48
|
+
def battle(player_1, player_2)
|
49
|
+
result = ActiveGenie::Battle.call(
|
50
|
+
player_1.content,
|
51
|
+
player_2.content,
|
52
|
+
@criteria,
|
53
|
+
config: @config
|
54
|
+
)
|
66
55
|
|
67
|
-
|
68
|
-
|
56
|
+
winner, loser = case result['winner']
|
57
|
+
when 'player_1' then [player_1, player_2, result['reasoning']]
|
58
|
+
when 'player_2' then [player_2, player_1, result['reasoning']]
|
59
|
+
when 'draw' then [nil, nil, result['reasoning']]
|
60
|
+
end
|
69
61
|
|
70
|
-
|
71
|
-
|
72
|
-
|
62
|
+
ActiveGenie::Logger.call({
|
63
|
+
code: :free_for_all_battle,
|
64
|
+
player_ids: [player_1.id, player_2.id],
|
65
|
+
winner_id: winner&.id,
|
66
|
+
loser_id: loser&.id,
|
67
|
+
reasoning: result['reasoning']
|
68
|
+
})
|
73
69
|
|
74
|
-
|
75
|
-
|
76
|
-
ranking_unique_key = [eligible_ids, @criteria, @config.to_json].join('-')
|
77
|
-
Digest::MD5.hexdigest(ranking_unique_key)
|
78
|
-
end
|
70
|
+
[winner, loser]
|
71
|
+
end
|
79
72
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
battles_count: matches.size,
|
84
|
-
duration_seconds: Time.now - @start_time,
|
85
|
-
total_tokens: @total_tokens,
|
86
|
-
}
|
87
|
-
end
|
73
|
+
def log_context
|
74
|
+
{ free_for_all_id: }
|
75
|
+
end
|
88
76
|
|
89
|
-
|
90
|
-
|
77
|
+
def free_for_all_id
|
78
|
+
eligible_ids = @players.eligible.map(&:id).join(',')
|
79
|
+
ranking_unique_key = [eligible_ids, @criteria, @config.to_json].join('-')
|
80
|
+
Digest::MD5.hexdigest(ranking_unique_key)
|
81
|
+
end
|
82
|
+
|
83
|
+
def report
|
84
|
+
{
|
85
|
+
free_for_all_id:,
|
86
|
+
battles_count: matches.size,
|
87
|
+
duration_seconds: Time.now - @start_time,
|
88
|
+
total_tokens: @total_tokens
|
89
|
+
}
|
90
|
+
end
|
91
|
+
|
92
|
+
def log_observer(log)
|
93
|
+
@total_tokens += log[:total_tokens] if log[:code] == :llm_usage
|
94
|
+
end
|
91
95
|
end
|
92
96
|
end
|
93
97
|
end
|
@@ -1,92 +1,100 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'digest'
|
2
4
|
|
3
|
-
module ActiveGenie
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
5
|
+
module ActiveGenie
|
6
|
+
module Ranking
|
7
|
+
class Player
|
8
|
+
def initialize(params)
|
9
|
+
params = { content: params } if params.is_a?(String)
|
10
|
+
|
11
|
+
@content = params[:content] || params
|
12
|
+
@name = params[:name] || params[:content][0..10]
|
13
|
+
@id = params[:id] || Digest::MD5.hexdigest(@content)
|
14
|
+
@score = params[:score] || nil
|
15
|
+
@elo = params[:elo] || nil
|
16
|
+
@ffa_win_count = params[:ffa_win_count] || 0
|
17
|
+
@ffa_lose_count = params[:ffa_lose_count] || 0
|
18
|
+
@ffa_draw_count = params[:ffa_draw_count] || 0
|
19
|
+
@eliminated = params[:eliminated] || nil
|
20
|
+
end
|
21
|
+
attr_accessor :rank
|
17
22
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
23
|
+
def score=(value)
|
24
|
+
ActiveGenie::Logger.call({ code: :new_score, player_id: id, score: value }) if value != @score
|
25
|
+
@score = value
|
26
|
+
@elo = generate_elo_by_score
|
27
|
+
end
|
22
28
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
29
|
+
def elo=(value)
|
30
|
+
ActiveGenie::Logger.call({ code: :new_elo, player_id: id, elo: value }) if value != @elo
|
31
|
+
@elo = value
|
32
|
+
end
|
28
33
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
34
|
+
def eliminated=(value)
|
35
|
+
ActiveGenie::Logger.call({ code: :new_eliminated, player_id: id, eliminated: value }) if value != @eliminated
|
36
|
+
@eliminated = value
|
37
|
+
end
|
33
38
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
def draw!
|
40
|
+
@ffa_draw_count += 1
|
41
|
+
ActiveGenie::Logger.call({ code: :new_ffa_score, player_id: id, result: 'draw', ffa_score: })
|
42
|
+
end
|
38
43
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
44
|
+
def win!
|
45
|
+
@ffa_win_count += 1
|
46
|
+
ActiveGenie::Logger.call({ code: :new_ffa_score, player_id: id, result: 'win', ffa_score: })
|
47
|
+
end
|
43
48
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
49
|
+
def lose!
|
50
|
+
@ffa_lose_count += 1
|
51
|
+
ActiveGenie::Logger.call({ code: :new_ffa_score, player_id: id, result: 'lose', ffa_score: })
|
52
|
+
end
|
48
53
|
|
49
|
-
|
50
|
-
@ffa_lose_count += 1
|
51
|
-
ActiveGenie::Logger.debug({ code: :new_ffa_score, player_id: id, result: 'lose', ffa_score: })
|
52
|
-
end
|
54
|
+
attr_reader :id, :content, :score, :elo, :ffa_win_count, :ffa_lose_count, :ffa_draw_count, :eliminated, :name
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
-
|
56
|
+
def ffa_score
|
57
|
+
@ffa_win_count * 3 + @ffa_draw_count
|
58
|
+
end
|
57
59
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
def sort_value
|
61
|
+
(ffa_score * 1_000_000) + ((elo || 0) * 100) + (score || 0)
|
62
|
+
end
|
63
|
+
|
64
|
+
def to_json(*_args)
|
65
|
+
to_h.to_json
|
66
|
+
end
|
67
|
+
|
68
|
+
def to_h
|
69
|
+
{
|
70
|
+
id:, name:, content:, score:, elo:,
|
71
|
+
ffa_win_count:, ffa_lose_count:, ffa_draw_count:,
|
72
|
+
eliminated:, ffa_score:, sort_value:
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
def method_missing(method_name, *args, &block)
|
77
|
+
if method_name == :[] && args.size == 1
|
78
|
+
attr_name = args.first.to_sym
|
65
79
|
|
66
|
-
|
67
|
-
if method_name == :[] && args.size == 1
|
68
|
-
attr_name = args.first.to_sym
|
80
|
+
return send(attr_name) if respond_to?(attr_name)
|
69
81
|
|
70
|
-
if respond_to?(attr_name)
|
71
|
-
return send(attr_name)
|
72
|
-
else
|
73
82
|
return nil
|
83
|
+
|
74
84
|
end
|
85
|
+
|
86
|
+
super
|
75
87
|
end
|
76
88
|
|
77
|
-
|
78
|
-
|
89
|
+
def respond_to_missing?(method_name, include_private = false)
|
90
|
+
method_name == :[] || super
|
91
|
+
end
|
79
92
|
|
80
|
-
|
81
|
-
|
82
|
-
|
93
|
+
def generate_elo_by_score
|
94
|
+
BASE_ELO + ((@score || 0) - 50)
|
95
|
+
end
|
83
96
|
|
84
|
-
|
85
|
-
BASE_ELO + ((@score || 0) - 50)
|
97
|
+
BASE_ELO = 1000
|
86
98
|
end
|
87
|
-
|
88
|
-
private
|
89
|
-
|
90
|
-
BASE_ELO = 1000
|
91
99
|
end
|
92
|
-
end
|
100
|
+
end
|