Class: Fog::Compute::Packet::SshKey
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Packet::SshKey
- Defined in:
- lib/fog/compute/packet/models/ssh_key.rb
Overview
SshKey
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ SshKey
constructor
A new instance of SshKey.
- #save ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ SshKey
Returns a new instance of SshKey.
18 19 20 |
# File 'lib/fog/compute/packet/models/ssh_key.rb', line 18 def initialize(attributes = {}) super end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
16 17 18 |
# File 'lib/fog/compute/packet/models/ssh_key.rb', line 16 def @options end |
Instance Method Details
#destroy ⇒ Object
42 43 44 45 46 47 |
# File 'lib/fog/compute/packet/models/ssh_key.rb', line 42 def destroy requires :id response = service.delete_ssh_key(id) true if response.status == 204 end |
#save ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/fog/compute/packet/models/ssh_key.rb', line 22 def save requires :label, :key = {} [:label] = label [:key] = key response = service.create_ssh_key() merge_attributes(response.body) end |
#update ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/fog/compute/packet/models/ssh_key.rb', line 32 def update requires :id = {} [:label] = label [:key] = key response = service.update_ssh_key(id, ) merge_attributes(response.body) end |