Class: Nexpose::RoleSummary
- Inherits:
-
Object
- Object
- Nexpose::RoleSummary
- Defined in:
- lib/nexpose/role.rb
Overview
Role summary object encapsulating information about a role.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ Object
A description of the role.
-
#enabled ⇒ Object
Whether or not the role is enabled.
-
#full_name ⇒ Object
The full name of the role.
-
#id ⇒ Object
The unique identifier of the role.
-
#name ⇒ Object
The short name of the role.
-
#scope ⇒ Object
Specifies if the role has global or silo scope.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, full_name, id, description, enabled = true, scope = Scope::SILO) ⇒ RoleSummary
constructor
A new instance of RoleSummary.
Constructor Details
#initialize(name, full_name, id, description, enabled = true, scope = Scope::SILO) ⇒ RoleSummary
Returns a new instance of RoleSummary.
100 101 102 |
# File 'lib/nexpose/role.rb', line 100 def initialize(name, full_name, id, description, enabled = true, scope = Scope::SILO) @name, @full_name, @id, @description, @enabled, @scope = name, full_name, id.to_i, description, enabled, scope end |
Instance Attribute Details
#description ⇒ Object
A description of the role.
91 92 93 |
# File 'lib/nexpose/role.rb', line 91 def description @description end |
#enabled ⇒ Object
Whether or not the role is enabled.
94 95 96 |
# File 'lib/nexpose/role.rb', line 94 def enabled @enabled end |
#full_name ⇒ Object
The full name of the role. Must be unique.
85 86 87 |
# File 'lib/nexpose/role.rb', line 85 def full_name @full_name end |
#id ⇒ Object
The unique identifier of the role.
88 89 90 |
# File 'lib/nexpose/role.rb', line 88 def id @id end |
#name ⇒ Object
The short name of the role. Must be unique.
82 83 84 |
# File 'lib/nexpose/role.rb', line 82 def name @name end |
#scope ⇒ Object
Specifies if the role has global or silo scope.
98 99 100 |
# File 'lib/nexpose/role.rb', line 98 def scope @scope end |
Class Method Details
.parse(xml) ⇒ Object
104 105 106 107 108 109 110 111 |
# File 'lib/nexpose/role.rb', line 104 def self.parse(xml) new(xml.attributes['name'], xml.attributes['full-name'], xml.attributes['id'].to_i, xml.attributes['description'], xml.attributes['enabled'] == 'true', xml.attributes['scope']) end |