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.
151 152 153 |
# File 'lib/nexpose/asset.rb', line 151 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.
149 150 151 |
# File 'lib/nexpose/asset.rb', line 149 def attributes @attributes end |
#full_name ⇒ Object (readonly)
Full name of the user.
147 148 149 |
# File 'lib/nexpose/asset.rb', line 147 def full_name @full_name end |
#id ⇒ Object (readonly)
Unique identifier of the user as determined by the asset (not Nexpose).
145 146 147 |
# File 'lib/nexpose/asset.rb', line 145 def id @id end |
#name ⇒ Object (readonly)
User account name.
143 144 145 |
# File 'lib/nexpose/asset.rb', line 143 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
162 163 164 165 166 167 168 169 170 |
# File 'lib/nexpose/asset.rb', line 162 def <=>(other) c = name <=> other.name return c unless c == 0 c = id <=> other.id return c unless c == 0 c = full_name <=> other.full_name return c unless c == 0 attributes <=> other.attributes end |
#==(other) ⇒ Object
172 173 174 |
# File 'lib/nexpose/asset.rb', line 172 def ==(other) eql?(other) end |
#eql?(other) ⇒ Boolean
176 177 178 |
# File 'lib/nexpose/asset.rb', line 176 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
155 156 157 158 159 160 |
# File 'lib/nexpose/asset.rb', line 155 def to_h { name: name, id: id, full_name: full_name, attributes: Attributes.to_hash(attributes) } end |