class GithubInfo::Github

Attributes

contributions[R]
name[R]
repositories[R]
user_name[R]

Public Class Methods

all() click to toggle source
# File lib/github-info/github.rb, line 25
def self.all
  return @@all
end
find_or_create_by_user_name(user_name) click to toggle source
# File lib/github-info/github.rb, line 16
def self.find_or_create_by_user_name(user_name)
  @@all.each do |profile|
    if user_name == profile.user_name
      return profile
    end
  end
  return self.new(user_name)
end
new(user_name) click to toggle source
# File lib/github-info/github.rb, line 7
def initialize(user_name)
  @user_name = user_name
  github_info = GithubInfo::Scraper.scrape(@user_name)
  @name = github_info[:user_info][:name]
  @contributions = github_info[:user_info][:contributions]
  @repositories = github_info[:repositories]
  @@all << self
end

Public Instance Methods

commit_history(index) click to toggle source
# File lib/github-info/github.rb, line 29
def commit_history(index)
  return GithubInfo::Scraper.get_commit_history(@repositories[index][:href])
end