Class: Gitlab::Ci::Reports::Security::Scan

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/reports/security/scan.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Scan

Returns a new instance of Scan.



10
11
12
13
14
15
16
# File 'lib/gitlab/ci/reports/security/scan.rb', line 10

def initialize(params = {})
  @type = params['type']
  @status = params['status']
  @start_time = params['start_time']
  @end_time = params['end_time']
  @partial_scan_mode = params.dig('partial_scan', 'mode')
end

Instance Attribute Details

#end_timeObject

Returns the value of attribute end_time.



8
9
10
# File 'lib/gitlab/ci/reports/security/scan.rb', line 8

def end_time
  @end_time
end

#partial_scan_modeObject

Returns the value of attribute partial_scan_mode.



8
9
10
# File 'lib/gitlab/ci/reports/security/scan.rb', line 8

def partial_scan_mode
  @partial_scan_mode
end

#start_timeObject

Returns the value of attribute start_time.



8
9
10
# File 'lib/gitlab/ci/reports/security/scan.rb', line 8

def start_time
  @start_time
end

#statusObject

Returns the value of attribute status.



8
9
10
# File 'lib/gitlab/ci/reports/security/scan.rb', line 8

def status
  @status
end

#typeObject

Returns the value of attribute type.



8
9
10
# File 'lib/gitlab/ci/reports/security/scan.rb', line 8

def type
  @type
end

Instance Method Details

#to_hashObject



18
19
20
21
22
23
24
25
# File 'lib/gitlab/ci/reports/security/scan.rb', line 18

def to_hash
  {
    type: type,
    status: status,
    start_time: start_time,
    end_time: end_time
  }.compact
end