class Reponaut::StatisticsCalculator
Attributes
repos[R]
Public Class Methods
new(repos)
click to toggle source
# File lib/reponaut/statistics.rb, line 5 def initialize(repos) @repos = repos end
Public Instance Methods
language_counts()
click to toggle source
# File lib/reponaut/statistics.rb, line 9 def language_counts langs = Hash.new { |hash, key| hash[key] = 0 } repos.group_by { |r| r.language }.map { |e| langs[e[0]] = e[1].count } langs end