Class: Nexpose::UserAccount
Overview
User accounts on an asset.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Account attributes.
-
#full_name ⇒ Object
readonly
Full name of the user.
-
#id ⇒ Object
readonly
Unique identifier of the user as determined by the asset (not Nexpose).
-
#name ⇒ Object
readonly
User account name.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(name = nil, id = 0, full_name = nil, attributes = []) ⇒ UserAccount
constructor
A new instance of UserAccount.
- #to_h ⇒ Object
Methods inherited from APIObject
Constructor Details
#initialize(name = nil, id = 0, full_name = nil, attributes = []) ⇒ UserAccount
Returns a new instance of UserAccount.
153 154 155 |
# File 'lib/nexpose/asset.rb', line 153 def initialize(name = nil, id = 0, full_name = nil, attributes = []) @id, @name, @full_name, @attributes = id, name, full_name, attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Account attributes.
151 152 153 |
# File 'lib/nexpose/asset.rb', line 151 def attributes @attributes end |
#full_name ⇒ Object (readonly)
Full name of the user.
149 150 151 |
# File 'lib/nexpose/asset.rb', line 149 def full_name @full_name end |
#id ⇒ Object (readonly)
Unique identifier of the user as determined by the asset (not Nexpose).
147 148 149 |
# File 'lib/nexpose/asset.rb', line 147 def id @id end |
#name ⇒ Object (readonly)
User account name.
145 146 147 |
# File 'lib/nexpose/asset.rb', line 145 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
164 165 166 167 168 169 170 171 172 |
# File 'lib/nexpose/asset.rb', line 164 def <=>(other) c = name <=> other.name return c unless c.zero? c = id <=> other.id return c unless c.zero? c = full_name <=> other.full_name return c unless c.zero? attributes <=> other.attributes end |
#==(other) ⇒ Object
174 175 176 |
# File 'lib/nexpose/asset.rb', line 174 def ==(other) eql?(other) end |
#eql?(other) ⇒ Boolean
178 179 180 |
# File 'lib/nexpose/asset.rb', line 178 def eql?(other) name.eql?(other.name) && id.eql?(other.id) && full_name.eql?(other.full_name) && attributes.eql?(other.attributes) end |
#to_h ⇒ Object
157 158 159 160 161 162 |
# File 'lib/nexpose/asset.rb', line 157 def to_h { name: name, id: id, full_name: full_name, attributes: Attributes.to_hash(attributes) } end |