Class: Fog::Compute::Packet::Organization
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Packet::Organization
- Defined in:
- lib/fog/compute/packet/models/organization.rb
Overview
Organization Model
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ Organization
constructor
A new instance of Organization.
- #save ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Organization
Returns a new instance of Organization.
24 25 26 |
# File 'lib/fog/compute/packet/models/organization.rb', line 24 def initialize(attributes = {}) super end |
Instance Method Details
#destroy ⇒ Object
63 64 65 66 67 |
# File 'lib/fog/compute/packet/models/organization.rb', line 63 def destroy requires :id response = service.delete_organization(id) true if response.status == 204 end |
#save ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/fog/compute/packet/models/organization.rb', line 28 def save requires :name = {} [:name] = name [:description] = description if description [:website] = website if website [:twitter] = twitter if twitter [:logo] = website if logo [:address] = address if address [:customdata] = customdata if customdata response = service.create_organization() merge_attributes(response.body) true end |
#update ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fog/compute/packet/models/organization.rb', line 47 def update requires :id = {} [:name] = name if name [:description] = description if description [:website] = website if website [:twitter] = twitter if twitter [:logo] = website if logo [:address] = address if address [:customdata] = customdata if customdata response = service.update_organization(id, ) merge_attributes(response.body) end |