Class: Fog::Identity::OpenStack::V3::Domain

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/identity/openstack/v3/models/domain.rb

Class Attribute Summary collapse

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize, #save

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Class Attribute Details

.cacheObject

Returns the value of attribute cache


16
17
18
# File 'lib/fog/identity/openstack/v3/models/domain.rb', line 16

def cache
  @cache
end

Instance Method Details

#createObject


41
42
43
44
45
46
47
48
# File 'lib/fog/identity/openstack/v3/models/domain.rb', line 41

def create
  clear_cache
  requires :name
  merge_attributes(
    service.create_domain(attributes).body['domain']
  )
  self
end

#destroyObject


25
26
27
28
29
30
# File 'lib/fog/identity/openstack/v3/models/domain.rb', line 25

def destroy
  clear_cache
  requires :id
  service.delete_domain(id)
  true
end

#to_sObject


21
22
23
# File 'lib/fog/identity/openstack/v3/models/domain.rb', line 21

def to_s
  name
end

#update(attr = nil) ⇒ Object


32
33
34
35
36
37
38
39
# File 'lib/fog/identity/openstack/v3/models/domain.rb', line 32

def update(attr = nil)
  clear_cache
  requires :id, :name
  merge_attributes(
    service.update_domain(id, attr || attributes).body['domain']
  )
  self
end