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.
101 102 103 104 105 106 107 108 |
# File 'lib/nexpose/role.rb', line 101 def initialize(name, full_name, id, description, enabled = true, scope = Scope::SILO) @name = name @full_name = full_name @id = id.to_i @description = description @enabled = enabled @scope = scope end |
Instance Attribute Details
#description ⇒ Object
A description of the role.
92 93 94 |
# File 'lib/nexpose/role.rb', line 92 def description @description end |
#enabled ⇒ Object
Whether or not the role is enabled.
95 96 97 |
# File 'lib/nexpose/role.rb', line 95 def enabled @enabled end |
#full_name ⇒ Object
The full name of the role. Must be unique.
86 87 88 |
# File 'lib/nexpose/role.rb', line 86 def full_name @full_name end |
#id ⇒ Object
The unique identifier of the role.
89 90 91 |
# File 'lib/nexpose/role.rb', line 89 def id @id end |
#name ⇒ Object
The short name of the role. Must be unique.
83 84 85 |
# File 'lib/nexpose/role.rb', line 83 def name @name end |
#scope ⇒ Object
Specifies if the role has global or silo scope.
99 100 101 |
# File 'lib/nexpose/role.rb', line 99 def scope @scope end |
Class Method Details
.parse(xml) ⇒ Object
110 111 112 113 114 115 116 117 |
# File 'lib/nexpose/role.rb', line 110 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 |