Class: Qualys::Scan

Inherits:
Object
  • Object
show all
Defined in:
lib/qualys/scans.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scan) ⇒ Scan

Returns a new instance of Scan.



28
29
30
31
32
33
34
35
36
37
# File 'lib/qualys/scans.rb', line 28

def initialize(scan)
  @ref = scan['REF']
  @title = scan['TITLE']
  @type = scan['TYPE']
  @date = scan['LAUNCH_DATETIME']
  @duration = scan['DURATION']
  @status = scan['STATUS']['STATE']
  @target = scan['TARGET']
  @user = scan['USER_LOGIN']
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



26
27
28
# File 'lib/qualys/scans.rb', line 26

def date
  @date
end

#durationObject

Returns the value of attribute duration.



26
27
28
# File 'lib/qualys/scans.rb', line 26

def duration
  @duration
end

#refObject

Returns the value of attribute ref.



26
27
28
# File 'lib/qualys/scans.rb', line 26

def ref
  @ref
end

#statusObject

Returns the value of attribute status.



26
27
28
# File 'lib/qualys/scans.rb', line 26

def status
  @status
end

#targetObject

Returns the value of attribute target.



26
27
28
# File 'lib/qualys/scans.rb', line 26

def target
  @target
end

#titleObject

Returns the value of attribute title.



26
27
28
# File 'lib/qualys/scans.rb', line 26

def title
  @title
end

#typeObject

Returns the value of attribute type.



26
27
28
# File 'lib/qualys/scans.rb', line 26

def type
  @type
end

#userObject

Returns the value of attribute user.



26
27
28
# File 'lib/qualys/scans.rb', line 26

def user
  @user
end

Instance Method Details

#detailsObject



39
40
41
# File 'lib/qualys/scans.rb', line 39

def details
  Scans.get(@ref)
end

#finished?Boolean

Returns:

  • (Boolean)


43
44
45
46
47
# File 'lib/qualys/scans.rb', line 43

def finished?
  return true if @status.eql? 'Finished'

  false
end