Class: Nexpose::UniqueIdentifier
- Defined in:
- lib/nexpose/asset.rb
Overview
Unique system identifiers on an asset.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Unique identifier of the user as determined by the asset (not Nexpose).
-
#source ⇒ Object
readonly
The source name for the uniuqe identifier.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(source = nil, id = nil) ⇒ UniqueIdentifier
constructor
A new instance of UniqueIdentifier.
- #to_h ⇒ Object
Methods inherited from APIObject
Constructor Details
#initialize(source = nil, id = nil) ⇒ UniqueIdentifier
Returns a new instance of UniqueIdentifier.
276 277 278 279 |
# File 'lib/nexpose/asset.rb', line 276 def initialize(source = nil, id = nil) @id = id @source = source end |
Instance Attribute Details
#id ⇒ Object (readonly)
Unique identifier of the user as determined by the asset (not Nexpose).
274 275 276 |
# File 'lib/nexpose/asset.rb', line 274 def id @id end |
#source ⇒ Object (readonly)
The source name for the uniuqe identifier.
272 273 274 |
# File 'lib/nexpose/asset.rb', line 272 def source @source end |
Instance Method Details
#<=>(other) ⇒ Object
286 287 288 289 290 |
# File 'lib/nexpose/asset.rb', line 286 def <=>(other) c = source <=> other.source return c unless c.zero? id <=> other.id end |
#==(other) ⇒ Object
292 293 294 |
# File 'lib/nexpose/asset.rb', line 292 def ==(other) eql?(other) end |
#eql?(other) ⇒ Boolean
296 297 298 |
# File 'lib/nexpose/asset.rb', line 296 def eql?(other) source.eql?(other.source) && id.eql?(other.id) end |
#to_h ⇒ Object
281 282 283 284 |
# File 'lib/nexpose/asset.rb', line 281 def to_h { source: source, id: id } end |