Module: Exoteric::Github
- Defined in:
- lib/exoteric/counters/github.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.id ⇒ Object
3 4 5 |
# File 'lib/exoteric/counters/github.rb', line 3 def self.id :github end |
Instance Method Details
#github_count ⇒ Object
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_url ⇒ Object
7 8 9 |
# File 'lib/exoteric/counters/github.rb', line 7 def github_url "https://api.github.com/repos/#{repo_name}" end |
#repo_name ⇒ Object
11 12 13 |
# File 'lib/exoteric/counters/github.rb', line 11 def repo_name [:github_repo] end |