class Rankmatic::Submission

Attributes

id[R]
scores[R]

Public Class Methods

new(id:, scores: []) click to toggle source
# File lib/rankmatic/submission.rb, line 5
def initialize(id:, scores: [])
  @id = id
  @scores = scores
end

Public Instance Methods

average() click to toggle source
# File lib/rankmatic/submission.rb, line 14
def average
  total / score_count
end
score_count() click to toggle source
# File lib/rankmatic/submission.rb, line 18
def score_count
  scores.length
end
total() click to toggle source
# File lib/rankmatic/submission.rb, line 10
def total
  scores.reduce(:+)
end