Class: CiToolkit::GitlabBot::Credentials

Inherits:
Object
  • Object
show all
Defined in:
lib/ci_toolkit/gitlab_bot.rb

Overview

Provides an endpoint and a private access token that can be used with the Gitlab client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint = ENV.fetch("GITLAB_API_URL", nil), project_access_token = ENV.fetch("GITLAB_PROJECT_ACCESS_TOKEN", nil)) ⇒ Credentials

Returns a new instance of Credentials.



14
15
16
17
18
19
20
# File 'lib/ci_toolkit/gitlab_bot.rb', line 14

def initialize(
  endpoint = ENV.fetch("GITLAB_API_URL", nil),
  project_access_token = ENV.fetch("GITLAB_PROJECT_ACCESS_TOKEN", nil)
)
  @endpoint = endpoint
  @project_access_token = project_access_token
end

Instance Attribute Details

#endpointObject (readonly)

Returns the value of attribute endpoint.



12
13
14
# File 'lib/ci_toolkit/gitlab_bot.rb', line 12

def endpoint
  @endpoint
end

#project_access_tokenObject (readonly)

Returns the value of attribute project_access_token.



12
13
14
# File 'lib/ci_toolkit/gitlab_bot.rb', line 12

def project_access_token
  @project_access_token
end