Class: CodeforcesAPI::Object::RanklistRow

Inherits:
Object
  • Object
show all
Defined in:
lib/codeforces_api/object/ranklist_row.rb

Constant Summary collapse

ATTRS =
[
  :party,
  :rank,
  :points,
  :penalty,
  :successfulHackCount,
  :unsuccessfulHackCount,
  :problemResults,
  :lastSubmissionTimeSeconds,
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(ranklist_row) ⇒ RanklistRow



17
18
19
20
21
# File 'lib/codeforces_api/object/ranklist_row.rb', line 17

def initialize ranklist_row
  ATTRS.each { |attr| instance_variable_set("@#{attr}", ranklist_row[attr.to_s]) }
  @party = Party.new(@party) if @party
  @problemResults = @problemResults.map { |pr| ProblemResult.new(pr) } if @problemResults
end