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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pipeline) ⇒ Reports

Returns a new instance of Reports.



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

def initialize(pipeline)
  @reports = {}
  @pipeline = pipeline
end

Instance Attribute Details

#pipelineObject (readonly)

Returns the value of attribute pipeline.



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

def pipeline
  @pipeline
end

#reportsObject (readonly)

Returns the value of attribute reports.



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

def reports
  @reports
end

Instance Method Details

#findingsObject



21
22
23
# File 'lib/gitlab/ci/reports/security/reports.rb', line 21

def findings
  reports.values.flat_map(&:findings)
end

#get_report(report_type, report_artifact) ⇒ Object



17
18
19
# File 'lib/gitlab/ci/reports/security/reports.rb', line 17

def get_report(report_type, report_artifact)
  reports[report_type] ||= Report.new(report_type, pipeline, report_artifact.created_at)
end