class Stefon::Surveyor::SurveyorStore

A store for the scores that each surveyor calculates, it takes the form of a hash where author names are keys, and points are values. Points are counts of lines or commits that belong to a person

Public Class Methods

new(default_val = 0) click to toggle source
Calls superclass method
# File lib/stefon/surveyor/surveyor.rb, line 9
def initialize(default_val = 0)
  super(default_val)
end

Public Instance Methods

merge_scores(scores_hash) click to toggle source
# File lib/stefon/surveyor/surveyor.rb, line 13
def merge_scores(scores_hash)
  dup = self.dup
  scores_hash.each_pair do |name, score|
    dup[name] += score
  end
  dup
end
weight_scores(weight) click to toggle source
# File lib/stefon/surveyor/surveyor.rb, line 21
def weight_scores(weight)
  dup = self.dup
  dup.each_pair do |name, score|
    dup[name] *= weight
  end
  dup
end