Class: BackupRepos::BackupGitlabEndpoint
- Defined in:
- lib/backup_repos/backup_gitlab_endpoint.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#private_token ⇒ Object
readonly
Returns the value of attribute private_token.
Instance Method Summary collapse
- #call ⇒ Object
- #client ⇒ Object
- #endpoint_host ⇒ Object
-
#initialize(settings) ⇒ BackupGitlabEndpoint
constructor
A new instance of BackupGitlabEndpoint.
- #repos ⇒ Object
Constructor Details
#initialize(settings) ⇒ BackupGitlabEndpoint
Returns a new instance of BackupGitlabEndpoint.
10 11 12 13 |
# File 'lib/backup_repos/backup_gitlab_endpoint.rb', line 10 def initialize(settings) @endpoint = settings.endpoint @private_token = settings.private_token end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
8 9 10 |
# File 'lib/backup_repos/backup_gitlab_endpoint.rb', line 8 def endpoint @endpoint end |
#private_token ⇒ Object (readonly)
Returns the value of attribute private_token.
8 9 10 |
# File 'lib/backup_repos/backup_gitlab_endpoint.rb', line 8 def private_token @private_token end |
Instance Method Details
#call ⇒ Object
15 16 17 |
# File 'lib/backup_repos/backup_gitlab_endpoint.rb', line 15 def call backup_repositories end |
#client ⇒ Object
23 24 25 26 27 28 |
# File 'lib/backup_repos/backup_gitlab_endpoint.rb', line 23 def client @client ||= ::Gitlab.client( private_token: private_token, endpoint: endpoint ) end |
#endpoint_host ⇒ Object
30 31 32 |
# File 'lib/backup_repos/backup_gitlab_endpoint.rb', line 30 def endpoint_host @endpoint_host ||= URI.parse(endpoint).host end |
#repos ⇒ Object
19 20 21 |
# File 'lib/backup_repos/backup_gitlab_endpoint.rb', line 19 def repos @repos ||= client.projects.auto_paginate end |