Class: Fog::Identity::Proxmox::Role

Inherits:
Proxmox::Model show all
Defined in:
lib/fog/identity/proxmox/models/role.rb

Overview

class Role model authentication

Instance Method Summary collapse

Methods inherited from Proxmox::Model

#initialize, #inspect

Constructor Details

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

Instance Method Details

#create(new_attributes = {}) ⇒ Object


43
44
45
# File 'lib/fog/identity/proxmox/models/role.rb', line 43

def create(new_attributes = {})
  service.create_role(attributes.merge(new_attributes))
end

#destroyObject


47
48
49
50
51
# File 'lib/fog/identity/proxmox/models/role.rb', line 47

def destroy
  requires :roleid
  service.delete_role(roleid)
  true
end

#to_sObject


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

def to_s
  roleid
end

#updateObject


53
54
55
56
57
# File 'lib/fog/identity/proxmox/models/role.rb', line 53

def update
  requires :roleid
  attr = attributes.reject { |key, _value| key == :roleid }
  service.update_role(roleid, attr)
end