Class: Fog::Proxmox::Identity::Domain
- Inherits:
-
Model
- Object
- Model
- Fog::Proxmox::Identity::Domain
- Defined in:
- lib/fog/proxmox/identity/models/domain.rb
Overview
class Domain model authentication
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(new_attributes = {}) ⇒ Domain
constructor
A new instance of Domain.
- #save(new_attributes = {}) ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(new_attributes = {}) ⇒ Domain
Returns a new instance of Domain.
28 29 30 31 |
# File 'lib/fog/proxmox/identity/models/domain.rb', line 28 def initialize(new_attributes = {}) initialize_type(new_attributes) super(new_attributes) end |
Instance Method Details
#destroy ⇒ Object
40 41 42 43 44 |
# File 'lib/fog/proxmox/identity/models/domain.rb', line 40 def destroy requires :realm service.delete_domain(realm) true end |
#save(new_attributes = {}) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/fog/proxmox/identity/models/domain.rb', line 33 def save(new_attributes = {}) service.create_domain(type.attributes.merge(new_attributes).merge(attributes.reject do |attribute| [:type].include? attribute end)) reload end |
#update ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/fog/proxmox/identity/models/domain.rb', line 46 def update requires :realm service.update_domain(realm, type.attributes.merge(attributes).reject do |attribute| %i[type realm].include? attribute end) reload end |