module Octokit::Configurable
def api_endpoint
def api_endpoint File.join(@api_endpoint, '') end
def configure
def configure yield self end
def fetch_client_id_and_secret(overrides = {})
def fetch_client_id_and_secret(overrides = {}) opts = options.merge(overrides) opts.values_at :client_id, :client_secret end
def keys
-
(Array)
- of option keys
def keys @keys ||= %i[ access_token api_endpoint auto_paginate bearer_token client_id client_secret connection_options default_media_type login management_console_endpoint management_console_password manage_ghes_endpoint manage_ghes_username manage_ghes_password middleware netrc netrc_file per_page password proxy ssl_verify_mode user_agent web_endpoint ] end
def login
def login @login ||= (user.login if token_authenticated?) end
def manage_ghes_endpoint
def manage_ghes_endpoint File.join(@manage_ghes_endpoint, '') end
def management_console_endpoint
def management_console_endpoint File.join(@management_console_endpoint, '') end
def netrc?
def netrc? !!@netrc end
def options
def options Octokit::Configurable.keys.to_h { |key| [key, instance_variable_get(:"@#{key}")] } end
def reset!
def reset! # rubocop:disable Style/HashEachMethods # # This may look like a `.keys.each` which should be replaced with `#each_key`, but # this doesn't actually work, since `#keys` is just a method we've defined ourselves. # The class doesn't fulfill the whole `Enumerable` contract. Octokit::Configurable.keys.each do |key| # rubocop:enable Style/HashEachMethods instance_variable_set(:"@#{key}", Octokit::Default.options[key]) end self end
def same_options?(opts)
-
(Boolean)
-
Parameters:
-
opts
(Hash
) -- Options to compare with current client options
def same_options?(opts) opts.hash == options.hash end
def web_endpoint
-
(String)
- Default: https://github.com/
def web_endpoint File.join(@web_endpoint, '') end