class GithubScore::Score

Public Class Methods

group_issue_types(username) click to toggle source
# File lib/github_score.rb, line 11
def self.group_issue_types(username)
  json_data = get_user_stats(username)
  grouped_counts = json_data.group_by { |w| w["type"] }.inject({}) do |tmphash, (k,v)|
    tmphash[k.to_sym] = v.size
    tmphash
  end
end

Private Class Methods

get_user_stats(username) click to toggle source
# File lib/github_score.rb, line 21
def self.get_user_stats(username)
  req = Net::HTTP.get(URI.parse("https://github.com/#{username}.json"))
  JSON.parse(req)
end