Class: Vx::ServiceConnector::Github::DeployKeys
- Inherits:
-
Struct
- Object
- Struct
- Vx::ServiceConnector::Github::DeployKeys
- Defined in:
- lib/vx/service_connector/github/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/github/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/github/deploy_keys.rb', line 4 def session @session end |
Instance Method Details
#all ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/vx/service_connector/github/deploy_keys.rb', line 6 def all begin session.deploy_keys(repo.full_name) rescue Octokit::NotFound [] end end |
#create(key_name, public_key) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/vx/service_connector/github/deploy_keys.rb', line 14 def create(key_name, public_key) session.add_deploy_key( repo.full_name, key_name, public_key ) end |
#destroy(key_name) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/vx/service_connector/github/deploy_keys.rb', line 22 def destroy(key_name) all.select do |key| key.title == key_name end.map do |key| session.remove_deploy_key(repo.full_name, key.id) end end |