Class: Fog::Compute::Packet::Project
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Packet::Project
- Defined in:
- lib/fog/compute/packet/models/project.rb
Overview
Project Model
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ Project
constructor
A new instance of Project.
- #save(payment_method_id = "") ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Project
Returns a new instance of Project.
24 25 26 |
# File 'lib/fog/compute/packet/models/project.rb', line 24 def initialize(attributes = {}) super end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
22 23 24 |
# File 'lib/fog/compute/packet/models/project.rb', line 22 def @options end |
Instance Method Details
#destroy ⇒ Object
38 39 40 41 42 43 |
# File 'lib/fog/compute/packet/models/project.rb', line 38 def destroy requires :id response = service.delete_project(id) true if response.status == 204 end |
#save(payment_method_id = "") ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/fog/compute/packet/models/project.rb', line 28 def save(payment_method_id = "") requires :name = {} [:name] = name [:payment_method_id] = payment_method_id if payment_method_id response = service.create_project() merge_attributes(response.body) end |