Class: DataValidation::Comparison::StateRankingComparison
Instance Attribute Summary
#category, #division_id, #logger_name, #season, #web_url
Instance Method Summary
collapse
#check_item, #compare, #compare_conf_standings, #compare_values, #initialize
Instance Method Details
#api_path ⇒ Object
7
8
9
|
# File 'lib/data_validation/comparison/state_ranking_comparison.rb', line 7
def api_path
'/rest/LaxPower/stateRanking'
end
|
#determine_request_body_and_logger_name ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/data_validation/comparison/state_ranking_comparison.rb', line 23
def determine_request_body_and_logger_name
@category = if web_url.match /bingrl/
'GIRLS'
elsif web_url.match /binboy/
'BOYS'
elsif web_url.match /binmen/
'MEN'
elsif web_url.match /binwom/
'WOMEN'
end
@season = "20#{web_url.match(/update(..)/)[1]}"
state = web_url.match(/\/rating([a-z]+).php/)[1]
@logger_name = "log/#{season}/#{category.downcase}/rating/rating_#{season}_#{category}_#{state}.log"
%Q|{"category":"#{category}","season":#{season},"state":"#{state.upcase}","currPage":1,"pageSize":1000}|
end
|
#field_array ⇒ Object
11
12
13
|
# File 'lib/data_validation/comparison/state_ranking_comparison.rb', line 11
def field_array
['rank', 'teamName', 'powerRating', 'sosRank', %w|record wins|, %w|record losses|, %w|record ties|, 'state']
end
|
#rank_field ⇒ Object
15
16
17
|
# File 'lib/data_validation/comparison/state_ranking_comparison.rb', line 15
def rank_field
'powerRating'
end
|
19
20
21
|
# File 'lib/data_validation/comparison/state_ranking_comparison.rb', line 19
def related_rank_field
'rank'
end
|