Class: Nexpose::RoleSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/role.rb

Overview

Role summary object encapsulating information about a role.

Direct Known Subclasses

Role

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#descriptionObject

A description of the role.



92
93
94
# File 'lib/nexpose/role.rb', line 92

def description
  @description
end

#enabledObject

Whether or not the role is enabled.



95
96
97
# File 'lib/nexpose/role.rb', line 95

def enabled
  @enabled
end

#full_nameObject

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

#idObject

The unique identifier of the role.



89
90
91
# File 'lib/nexpose/role.rb', line 89

def id
  @id
end

#nameObject

The short name of the role. Must be unique.



83
84
85
# File 'lib/nexpose/role.rb', line 83

def name
  @name
end

#scopeObject

Specifies if the role has global or silo scope.

See Also:



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