Class: Nexpose::GroupAccount
- Defined in:
- lib/nexpose/asset.rb
Overview
Group accounts on an asset.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Group attributes.
-
#id ⇒ Object
readonly
Unique identifier of the group as determined by the asset (not Nexpose).
-
#name ⇒ Object
readonly
Group account name.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(name = nil, id = 0, attributes = []) ⇒ GroupAccount
constructor
A new instance of GroupAccount.
- #to_h ⇒ Object
Methods inherited from APIObject
Constructor Details
#initialize(name = nil, id = 0, attributes = []) ⇒ GroupAccount
Returns a new instance of GroupAccount.
193 194 195 196 197 |
# File 'lib/nexpose/asset.rb', line 193 def initialize(name = nil, id = 0, attributes = []) @name = name @id = id @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Group attributes.
191 192 193 |
# File 'lib/nexpose/asset.rb', line 191 def attributes @attributes end |
#id ⇒ Object (readonly)
Unique identifier of the group as determined by the asset (not Nexpose).
189 190 191 |
# File 'lib/nexpose/asset.rb', line 189 def id @id end |
#name ⇒ Object (readonly)
Group account name.
187 188 189 |
# File 'lib/nexpose/asset.rb', line 187 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
205 206 207 208 209 210 211 |
# File 'lib/nexpose/asset.rb', line 205 def <=>(other) c = name <=> other.name return c unless c == 0 c = id <=> other.id return c unless c == 0 attributes <=> other.attributes end |
#==(other) ⇒ Object
213 214 215 |
# File 'lib/nexpose/asset.rb', line 213 def ==(other) eql?(other) end |
#eql?(other) ⇒ Boolean
217 218 219 |
# File 'lib/nexpose/asset.rb', line 217 def eql?(other) name.eql?(other.name) && id.eql?(other.id) && attributes.eql?(other.attributes) end |
#to_h ⇒ Object
199 200 201 202 203 |
# File 'lib/nexpose/asset.rb', line 199 def to_h { name: name, id: id, attributes: Attributes.to_hash(attributes) } end |