Class: Fog::Compute::Packet::Organization

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

Overview

Organization Model

Instance Method Summary collapse

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

#destroyObject



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

#saveObject



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

  options = {}
  options[:name] = name

  options[:description] = description if description
  options[:website] = website if website
  options[:twitter] = twitter if twitter
  options[:logo] = website if 
  options[:address] = address if address
  options[:customdata] = customdata if customdata

  response = service.create_organization(options)

  merge_attributes(response.body)
  true
end

#updateObject



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
  options = {}

  options[:name] = name if name
  options[:description] = description if description
  options[:website] = website if website
  options[:twitter] = twitter if twitter
  options[:logo] = website if 
  options[:address] = address if address
  options[:customdata] = customdata if customdata

  response = service.update_organization(id, options)
  merge_attributes(response.body)
end