Class: GithubStats::GithubClient
- Inherits:
-
Object
- Object
- GithubStats::GithubClient
- Defined in:
- lib/github_stats/github_client.rb
Overview
Encapsulates github interactions so we can inject boring defaults and auto-paginate and potentially throttle or whatever.
Instance Attribute Summary collapse
-
#octokit ⇒ Object
Returns the value of attribute octokit.
Instance Method Summary collapse
-
#initialize(options) ⇒ GithubClient
constructor
A new instance of GithubClient.
- #search_issues(query, options = { per_page: 100 }) ⇒ Object
Constructor Details
#initialize(options) ⇒ GithubClient
Returns a new instance of GithubClient.
7 8 9 10 11 |
# File 'lib/github_stats/github_client.rb', line 7 def initialize() self.octokit = Octokit::Client.new(access_token: [:github_access_token], auto_paginate: true) end |
Instance Attribute Details
#octokit ⇒ Object
Returns the value of attribute octokit.
5 6 7 |
# File 'lib/github_stats/github_client.rb', line 5 def octokit @octokit end |
Instance Method Details
#search_issues(query, options = { per_page: 100 }) ⇒ Object
13 14 15 |
# File 'lib/github_stats/github_client.rb', line 13 def search_issues(query, = { per_page: 100 }) octokit.search_issues(query, ) end |