Sha256: 5e9240c5ce8d6eef27d4f81659be6ab7d8089d739a43d54017e54e1e90c8aeb9

Contents?: true

Size: 1.87 KB

Versions: 24

Compression:

Stored size: 1.87 KB

Contents

# frozen_string_literal: true

require 'octokit/configurable'
require 'octokit/connection'
require 'octokit/warnable'
require 'octokit/enterprise_management_console_client/management_console'

module Octokit
  # EnterpriseManagementConsoleClient is only meant to be used by GitHub Enterprise Admins
  # and provides access to the management console API endpoints.
  #
  # @see Octokit::Client Use Octokit::Client for regular API use for GitHub
  #   and GitHub Enterprise.
  # @see https://developer.github.com/v3/enterprise-admin/management_console/
  class EnterpriseManagementConsoleClient
    include Octokit::Configurable
    include Octokit::Connection
    include Octokit::Warnable
    include Octokit::EnterpriseManagementConsoleClient::ManagementConsole

    def initialize(options = {})
      # Use options passed in, but fall back to module defaults
      # 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}", options[key] || Octokit.instance_variable_get(:"@#{key}"))
      end
    end

    protected

    def endpoint
      management_console_endpoint
    end

    # Set Enterprise Management Console password
    #
    # @param value [String] Management console admin password
    def management_console_password=(value)
      reset_agent
      @management_console_password = value
    end

    # Set Enterprise Management Console endpoint
    #
    # @param value [String] Management console endpoint
    def management_console_endpoint=(value)
      reset_agent
      @management_console_endpoint = value
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
octokit-9.2.0 lib/octokit/enterprise_management_console_client.rb
octokit-9.1.0 lib/octokit/enterprise_management_console_client.rb
octokit-9.0.0 lib/octokit/enterprise_management_console_client.rb
octokit-8.1.0 lib/octokit/enterprise_management_console_client.rb
octokit-8.0.0 lib/octokit/enterprise_management_console_client.rb
octokit-7.2.0 lib/octokit/enterprise_management_console_client.rb
octokit-7.1.0 lib/octokit/enterprise_management_console_client.rb
octokit-7.0.0 lib/octokit/enterprise_management_console_client.rb
octokit-6.1.1 lib/octokit/enterprise_management_console_client.rb
octokit-6.1.0 lib/octokit/enterprise_management_console_client.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client.rb
octokit-6.0.1 lib/octokit/enterprise_management_console_client.rb
octokit-6.0.0 lib/octokit/enterprise_management_console_client.rb
octokit-5.6.1 lib/octokit/enterprise_management_console_client.rb
octokit-5.6.0 lib/octokit/enterprise_management_console_client.rb
octokit-5.5.0 lib/octokit/enterprise_management_console_client.rb
octokit-5.4.0 lib/octokit/enterprise_management_console_client.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/octokit-5.3.0/lib/octokit/enterprise_management_console_client.rb
octokit-5.3.0 lib/octokit/enterprise_management_console_client.rb
octokit-5.2.0 lib/octokit/enterprise_management_console_client.rb