Class: CIRunner::Client::Base
- Inherits:
-
Object
- Object
- CIRunner::Client::Base
- Defined in:
- lib/ci_runner/client/base.rb
Class Method Summary collapse
-
.default_client ⇒ Net::HTTP
An instance of Net:HTTP configured to make requests to the GitHub API endpoint.
Instance Method Summary collapse
-
#initialize(access_token = nil, client = self.class.default_client) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(access_token = nil, client = self.class.default_client) ⇒ Base
Returns a new instance of Base.
22 23 24 25 |
# File 'lib/ci_runner/client/base.rb', line 22 def initialize(access_token = nil, client = self.class.default_client) @access_token = access_token @client = client end |
Class Method Details
.default_client ⇒ Net::HTTP
Returns An instance of Net:HTTP configured to make requests to the GitHub API endpoint.
11 12 13 14 15 16 17 18 |
# File 'lib/ci_runner/client/base.rb', line 11 def self.default_client Net::HTTP.new(self::API_ENDPOINT, 443).tap do |http| http.use_ssl = true http.read_timeout = 3 http.write_timeout = 3 http.verify_mode = OpenSSL::SSL::VERIFY_PEER end end |