Class: Nexpose::SiloSummary

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

Overview

Object that represents the summary of a Nexpose Site.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ SiloSummary

Returns a new instance of SiloSummary.



334
335
336
# File 'lib/nexpose/silo.rb', line 334

def initialize(&block)
  instance_eval(&block) if block_given?
end

Instance Attribute Details

#assetsObject (readonly)

The asset count for this silo



324
325
326
# File 'lib/nexpose/silo.rb', line 324

def assets
  @assets
end

#descriptionObject (readonly)

A description of the silo.



320
321
322
# File 'lib/nexpose/silo.rb', line 320

def description
  @description
end

#idObject (readonly)

The silo ID.



316
317
318
# File 'lib/nexpose/silo.rb', line 316

def id
  @id
end

#max_assetsObject (readonly)

The asset count limit for this silo.



326
327
328
# File 'lib/nexpose/silo.rb', line 326

def max_assets
  @max_assets
end

#max_hosted_assetsObject (readonly)

The hosted asset count limit for this silo.



328
329
330
# File 'lib/nexpose/silo.rb', line 328

def max_hosted_assets
  @max_hosted_assets
end

#max_usersObject (readonly)

The user count limit for this silo.



332
333
334
# File 'lib/nexpose/silo.rb', line 332

def max_users
  @max_users
end

#nameObject (readonly)

The silo name.



318
319
320
# File 'lib/nexpose/silo.rb', line 318

def name
  @name
end

#profile_idObject (readonly)

The ID of the silo profile being used for this silo.



322
323
324
# File 'lib/nexpose/silo.rb', line 322

def profile_id
  @profile_id
end

#usersObject (readonly)

The user count for this silo



330
331
332
# File 'lib/nexpose/silo.rb', line 330

def users
  @users
end

Class Method Details

.parse(xml) ⇒ Object



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/nexpose/silo.rb', line 338

def self.parse(xml)
  new do
    @id          = xml.attributes['id']
    @name        = xml.attributes['name']
    @description = xml.attributes['description']
    @profile_id  = xml.attributes['silo-profile-id']
    xml.elements.each('LicenseSummary') do |license|
      @assets            = license.attributes['assets']
      @max_assets        = license.attributes['max-assets']
      @max_hosted_assets = license.attributes['max-hosted-assets']
      @users             = license.attributes['users']
      @max_users         = license.attributes['max-users']
    end
  end
end