Class: Gitlab::API

Inherits:
Request show all
Defined in:
lib/gitlab/api.rb

Direct Known Subclasses

Client

Instance Attribute Summary

Attributes inherited from Request

#endpoint, #pat_prefix, #private_token

Instance Method Summary collapse

Methods inherited from Request

decode, parse, #request_defaults, #validate

Constructor Details

#initialize(options = {}) ⇒ API

Creates a new API. rubocop:disable Lint/MissingSuper

Raises:

  • (Error:MissingCredentials)


14
15
16
17
18
19
20
21
# File 'lib/gitlab/api.rb', line 14

def initialize(options = {})
  options = Gitlab.options.merge(options)
  (Configuration::VALID_OPTIONS_KEYS + [:auth_token]).each do |key|
    send("#{key}=", options[key]) if options[key]
  end
  request_defaults(sudo)
  self.class.headers 'User-Agent' => user_agent
end