Class: Fog::Compute::ProfitBricks::Datacenter
- Inherits:
-
Models::ProfitBricks::Base
- Object
- Model
- Models::ProfitBricks::Base
- Fog::Compute::ProfitBricks::Datacenter
- Includes:
- Helpers::ProfitBricks::DataHelper
- Defined in:
- lib/fog/profitbricks/models/compute/datacenter.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(attributes = {}) ⇒ Datacenter
constructor
A new instance of Datacenter.
- #save ⇒ Object
- #update ⇒ Object
Methods included from Helpers::ProfitBricks::DataHelper
Methods inherited from Models::ProfitBricks::Base
#failed?, #ready?, #request_status, #wait_for
Constructor Details
#initialize(attributes = {}) ⇒ Datacenter
Returns a new instance of Datacenter.
28 29 30 |
# File 'lib/fog/profitbricks/models/compute/datacenter.rb', line 28 def initialize(attributes = {}) super end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
26 27 28 |
# File 'lib/fog/profitbricks/models/compute/datacenter.rb', line 26 def @options end |
Instance Method Details
#delete ⇒ Object
56 57 58 59 60 |
# File 'lib/fog/profitbricks/models/compute/datacenter.rb', line 56 def delete requires :id data = service.delete_datacenter(id) true end |
#save ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/fog/profitbricks/models/compute/datacenter.rb', line 32 def save requires :name, :location = {} [:name] = name [:location] = location [:description] = description if description data = service.create_datacenter() merge_attributes(flatten(data.body)) true end |
#update ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/fog/profitbricks/models/compute/datacenter.rb', line 45 def update requires :id = {} [:name] = name if name [:description] = description if description data = service.update_datacenter(id, ) merge_attributes(flatten(data.body)) true end |