Class: Fog::Compute::Packet::Email
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Packet::Email
- Defined in:
- lib/fog/compute/packet/models/email.rb
Overview
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ Email
constructor
A new instance of Email.
- #save ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Email
Returns a new instance of Email.
14 15 16 |
# File 'lib/fog/compute/packet/models/email.rb', line 14 def initialize(attributes = {}) super end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
12 13 14 |
# File 'lib/fog/compute/packet/models/email.rb', line 12 def @options end |
Instance Method Details
#destroy ⇒ Object
41 42 43 44 45 46 |
# File 'lib/fog/compute/packet/models/email.rb', line 41 def destroy requires :id response = service.delete_email(id) true if response.status == 204 end |
#save ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/fog/compute/packet/models/email.rb', line 18 def save requires :address = {} [:address] = address [:default] = default response = service.create_email() merge_attributes(response.body) end |
#update ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fog/compute/packet/models/email.rb', line 29 def update requires :id = {} [:address] = address [:default] = default response = service.update_email(id, ) merge_attributes(response.body) end |