Class: Fog::Compute::Packet::Email

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/compute/packet/models/email.rb

Overview

Email

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#optionsObject

Returns the value of attribute options.



12
13
14
# File 'lib/fog/compute/packet/models/email.rb', line 12

def options
  @options
end

Instance Method Details

#destroyObject



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

#saveObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/fog/compute/packet/models/email.rb', line 18

def save
  requires :address

  options = {}
  options[:address] = address
  options[:default] = default

  response = service.create_email(options)
  merge_attributes(response.body)
end

#updateObject



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

  options = {}
  options[:address] = address
  options[:default] = default

  response = service.update_email(id, options)

  merge_attributes(response.body)
end