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
# File 'lib/gitlab/ci/reports/security/scan.rb', line 10

def initialize(params = {})
  @type = params.dig('type')
  @status = params.dig('status')
  @start_time = params.dig('start_time')
  @end_time = params.dig('end_time')
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

#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


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

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