Class: Vx::ServiceConnector::GitlabV4::DeployKeys
- Inherits:
-
Struct
- Object
- Struct
- Vx::ServiceConnector::GitlabV4::DeployKeys
- Defined in:
- lib/vx/service_connector/gitlab_v4/deploy_keys.rb
Instance Attribute Summary collapse
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
Instance Attribute Details
#repo ⇒ Object
Returns the value of attribute repo
4 5 6 |
# File 'lib/vx/service_connector/gitlab_v4/deploy_keys.rb', line 4 def repo @repo end |
#session ⇒ Object
Returns the value of attribute session
4 5 6 |
# File 'lib/vx/service_connector/gitlab_v4/deploy_keys.rb', line 4 def session @session end |
Instance Method Details
#all ⇒ Object
6 7 8 |
# File 'lib/vx/service_connector/gitlab_v4/deploy_keys.rb', line 6 def all session.get "/user/keys" end |
#create(key_name, public_key) ⇒ Object
10 11 12 13 |
# File 'lib/vx/service_connector/gitlab_v4/deploy_keys.rb', line 10 def create(key_name, public_key) key_name = compute_key_name(key_name) session.post "/user/keys", title: key_name, key: public_key end |
#destroy(key_name) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/vx/service_connector/gitlab_v4/deploy_keys.rb', line 15 def destroy(key_name) key_name = compute_key_name(key_name) all.select do |key| key.title == key_name end.map do |key| session.delete "/user/keys/#{key.id}" end end |