Class: Fog::Proxmox::Identity::Domain

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/identity/proxmox/models/domain.rb

Overview

class Domain model authentication

Instance Method Summary collapse

Constructor Details

#initialize(new_attributes = {}) ⇒ Domain

Returns a new instance of Domain.



28
29
30
31
# File 'lib/fog/identity/proxmox/models/domain.rb', line 28

def initialize(new_attributes = {})
  initialize_type(new_attributes)
  super(new_attributes)
end

Instance Method Details

#destroyObject



38
39
40
41
42
# File 'lib/fog/identity/proxmox/models/domain.rb', line 38

def destroy
  requires :realm
  service.delete_domain(realm)
  true
end

#save(new_attributes = {}) ⇒ Object



33
34
35
36
# File 'lib/fog/identity/proxmox/models/domain.rb', line 33

def save(new_attributes = {})
  service.create_domain(type.attributes.merge(new_attributes).merge(attributes.reject { |attribute| [:type].include? attribute }))
  reload
end

#updateObject



44
45
46
47
48
# File 'lib/fog/identity/proxmox/models/domain.rb', line 44

def update
  requires :realm
  service.update_domain(realm, type.attributes.merge(attributes).reject { |attribute| [:type, :realm].include? attribute })
  reload
end