Class: Fog::Compute::Packet::License
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Packet::License
- Defined in:
- lib/fog/compute/packet/models/license.rb
Overview
License Model
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ License
constructor
A new instance of License.
- #save ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ License
Returns a new instance of License.
17 18 19 |
# File 'lib/fog/compute/packet/models/license.rb', line 17 def initialize(attributes = {}) super end |
Instance Method Details
#destroy ⇒ Object
46 47 48 49 50 51 |
# File 'lib/fog/compute/packet/models/license.rb', line 46 def destroy requires :id response = service.delete_license(id) true if response.status == 204 end |
#save ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fog/compute/packet/models/license.rb', line 21 def save requires :project_id, :description, :size = { :description => description, :size => size } [:license_product_id] = license_product_id if license_product_id response = service.create_license(project_id, ) merge_attributes(response.body) if response.status == 201 end |
#update ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fog/compute/packet/models/license.rb', line 35 def update requires :id = { :description => description, :size => size } response = service.update_license(id, ) merge_attributes(response.body) if response.status == 200 end |