Class: Nexpose::UserSummary
- Inherits:
-
Object
- Object
- Nexpose::UserSummary
- Defined in:
- lib/nexpose/user.rb
Overview
Summary only returned by API when issuing a listing request.
Instance Attribute Summary collapse
-
#auth_module ⇒ Object
readonly
Returns the value of attribute auth_module.
-
#auth_source ⇒ Object
readonly
Returns the value of attribute auth_source.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#group_count ⇒ Object
readonly
Returns the value of attribute group_count.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_admin ⇒ Object
readonly
Returns the value of attribute is_admin.
-
#is_disabled ⇒ Object
readonly
Returns the value of attribute is_disabled.
-
#is_locked ⇒ Object
readonly
Returns the value of attribute is_locked.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#site_count ⇒ Object
readonly
Returns the value of attribute site_count.
Class Method Summary collapse
-
.parse(summary) ⇒ Object
Provide a list of user accounts and information about those accounts.
Instance Method Summary collapse
-
#initialize(id, auth_source, auth_module, name, full_name, email, is_admin, is_disabled, is_locked, site_count, group_count) ⇒ UserSummary
constructor
A new instance of UserSummary.
Constructor Details
#initialize(id, auth_source, auth_module, name, full_name, email, is_admin, is_disabled, is_locked, site_count, group_count) ⇒ UserSummary
Returns a new instance of UserSummary.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/nexpose/user.rb', line 49 def initialize(id, auth_source, auth_module, name, full_name, email, is_admin, is_disabled, is_locked, site_count, group_count) @id = id @auth_source = auth_source @auth_module = auth_module @name = name @full_name = full_name @email = email @is_admin = is_admin @is_disabled = is_disabled @is_locked = is_locked @site_count = site_count @group_count = group_count end |
Instance Attribute Details
#auth_module ⇒ Object (readonly)
Returns the value of attribute auth_module.
46 47 48 |
# File 'lib/nexpose/user.rb', line 46 def auth_module @auth_module end |
#auth_source ⇒ Object (readonly)
Returns the value of attribute auth_source.
46 47 48 |
# File 'lib/nexpose/user.rb', line 46 def auth_source @auth_source end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
46 47 48 |
# File 'lib/nexpose/user.rb', line 46 def email @email end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
46 47 48 |
# File 'lib/nexpose/user.rb', line 46 def full_name @full_name end |
#group_count ⇒ Object (readonly)
Returns the value of attribute group_count.
47 48 49 |
# File 'lib/nexpose/user.rb', line 47 def group_count @group_count end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
46 47 48 |
# File 'lib/nexpose/user.rb', line 46 def id @id end |
#is_admin ⇒ Object (readonly)
Returns the value of attribute is_admin.
47 48 49 |
# File 'lib/nexpose/user.rb', line 47 def is_admin @is_admin end |
#is_disabled ⇒ Object (readonly)
Returns the value of attribute is_disabled.
47 48 49 |
# File 'lib/nexpose/user.rb', line 47 def is_disabled @is_disabled end |
#is_locked ⇒ Object (readonly)
Returns the value of attribute is_locked.
47 48 49 |
# File 'lib/nexpose/user.rb', line 47 def is_locked @is_locked end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
46 47 48 |
# File 'lib/nexpose/user.rb', line 46 def name @name end |
#site_count ⇒ Object (readonly)
Returns the value of attribute site_count.
47 48 49 |
# File 'lib/nexpose/user.rb', line 47 def site_count @site_count end |
Class Method Details
.parse(summary) ⇒ Object
Provide a list of user accounts and information about those accounts.
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/nexpose/user.rb', line 64 def self.parse(summary) new(summary.attributes['id'].to_i, summary.attributes['authSource'], summary.attributes['authModule'], summary.attributes['userName'], summary.attributes['fullName'], summary.attributes['email'], summary.attributes['administrator'].to_s.chomp.eql?('1'), summary.attributes['disabled'].to_s.chomp.eql?('1'), summary.attributes['locked'].to_s.chomp.eql?('1'), summary.attributes['siteCount'].to_i, summary.attributes['groupCount'].to_i) end |