Class: Prpr::Repository::Github
- Inherits:
-
Object
- Object
- Prpr::Repository::Github
- Defined in:
- lib/prpr/repository/github.rb
Class Method Summary collapse
- .access_token ⇒ Object
- .api_endpoint ⇒ Object
- .client_options ⇒ Object
- .client_options_with_nil_value ⇒ Object
- .default ⇒ Object
- .env ⇒ Object
- .github_host ⇒ Object
- .web_endpoint ⇒ Object
Class Method Details
.access_token ⇒ Object
35 36 37 |
# File 'lib/prpr/repository/github.rb', line 35 def access_token env[:github_access_token] end |
.api_endpoint ⇒ Object
27 28 29 |
# File 'lib/prpr/repository/github.rb', line 27 def api_endpoint "https://#{github_host}/api/v3" if github_host end |
.client_options ⇒ Object
11 12 13 |
# File 'lib/prpr/repository/github.rb', line 11 def .reject {|key, value| value.nil? } end |
.client_options_with_nil_value ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/prpr/repository/github.rb', line 15 def { access_token: access_token, api_endpoint: api_endpoint, web_endpoint: web_endpoint, } end |
.default ⇒ Object
7 8 9 |
# File 'lib/prpr/repository/github.rb', line 7 def default Octokit::Client.new() end |
.env ⇒ Object
31 32 33 |
# File 'lib/prpr/repository/github.rb', line 31 def env @env ||= Prpr::Config::Env.default end |
.github_host ⇒ Object
39 40 41 |
# File 'lib/prpr/repository/github.rb', line 39 def github_host env[:github_host] end |
.web_endpoint ⇒ Object
23 24 25 |
# File 'lib/prpr/repository/github.rb', line 23 def web_endpoint "https://#{github_host}/" if github_host end |