Module: Exoteric::Github

Defined in:
lib/exoteric/counters/github.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.idObject



3
4
5
# File 'lib/exoteric/counters/github.rb', line 3

def self.id
  :github
end

Instance Method Details

#github_countObject



15
16
17
18
19
20
# File 'lib/exoteric/counters/github.rb', line 15

def github_count
  res = RestClient.get(github_url)
  JSON.parse(res.to_str)['watchers_count'].to_i
rescue
  0
end

#github_urlObject



7
8
9
# File 'lib/exoteric/counters/github.rb', line 7

def github_url
  "https://api.github.com/repos/#{repo_name}"
end

#repo_nameObject



11
12
13
# File 'lib/exoteric/counters/github.rb', line 11

def repo_name
  options[:github_repo]
end