class GhTrend::GithubApi
Public Class Methods
new()
click to toggle source
# File lib/gh-trend/github_api.rb, line 7 def initialize @client = Octokit::Client.new :netrc => File.exist?(ENV["HOME"] + "/.netrc") begin @authenticate = !@client.user.nil? rescue @authenticate = false end end
Public Instance Methods
check_star?(repo)
click to toggle source
GET /user/starred/:owner/:repo
# File lib/gh-trend/github_api.rb, line 21 def check_star?(repo) # repo = [] # repo << args @client.starred?(repo) end
star(repo)
click to toggle source
# File lib/gh-trend/github_api.rb, line 27 def star(repo) @client.star(repo) end
unstar(repo)
click to toggle source
# File lib/gh-trend/github_api.rb, line 31 def unstar(repo) @client.unstar(repo) end
user_authenticated?()
click to toggle source
# File lib/gh-trend/github_api.rb, line 16 def user_authenticated? @authenticate end