Class: Nexpose::UserSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/user.rb

Overview

Summary only returned by API when issuing a listing request.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_moduleObject (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_sourceObject (readonly)

Returns the value of attribute auth_source.



46
47
48
# File 'lib/nexpose/user.rb', line 46

def auth_source
  @auth_source
end

#emailObject (readonly)

Returns the value of attribute email.



46
47
48
# File 'lib/nexpose/user.rb', line 46

def email
  @email
end

#full_nameObject (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_countObject (readonly)

Returns the value of attribute group_count.



47
48
49
# File 'lib/nexpose/user.rb', line 47

def group_count
  @group_count
end

#idObject (readonly)

Returns the value of attribute id.



46
47
48
# File 'lib/nexpose/user.rb', line 46

def id
  @id
end

#is_adminObject (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_disabledObject (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_lockedObject (readonly)

Returns the value of attribute is_locked.



47
48
49
# File 'lib/nexpose/user.rb', line 47

def is_locked
  @is_locked
end

#nameObject (readonly)

Returns the value of attribute name.



46
47
48
# File 'lib/nexpose/user.rb', line 46

def name
  @name
end

#site_countObject (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