Class: Gitlab::Ci::Badge::Coverage::Report
- Defined in:
- lib/gitlab/ci/badge/coverage/report.rb
Overview
Test coverage report badge
Instance Attribute Summary collapse
-
#customization ⇒ Object
readonly
Returns the value of attribute customization.
-
#job ⇒ Object
readonly
Returns the value of attribute job.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
Instance Method Summary collapse
- #entity ⇒ Object
-
#initialize(project, ref, opts: { job: nil }) ⇒ Report
constructor
A new instance of Report.
- #metadata ⇒ Object
- #status ⇒ Object
- #template ⇒ Object
Constructor Details
#initialize(project, ref, opts: { job: nil }) ⇒ Report
Returns a new instance of Report.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gitlab/ci/badge/coverage/report.rb', line 12 def initialize(project, ref, opts: { job: nil }) @project = project @ref = ref @job = opts[:job] @customization = { key_width: opts[:key_width].to_i, key_text: opts[:key_text], min_good: opts[:min_good].to_i, min_acceptable: opts[:min_acceptable].to_i, min_medium: opts[:min_medium].to_i } end |
Instance Attribute Details
#customization ⇒ Object (readonly)
Returns the value of attribute customization.
10 11 12 |
# File 'lib/gitlab/ci/badge/coverage/report.rb', line 10 def customization @customization end |
#job ⇒ Object (readonly)
Returns the value of attribute job.
10 11 12 |
# File 'lib/gitlab/ci/badge/coverage/report.rb', line 10 def job @job end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
10 11 12 |
# File 'lib/gitlab/ci/badge/coverage/report.rb', line 10 def project @project end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
10 11 12 |
# File 'lib/gitlab/ci/badge/coverage/report.rb', line 10 def ref @ref end |
Instance Method Details
#entity ⇒ Object
25 26 27 |
# File 'lib/gitlab/ci/badge/coverage/report.rb', line 25 def entity 'coverage' end |
#metadata ⇒ Object
36 37 38 |
# File 'lib/gitlab/ci/badge/coverage/report.rb', line 36 def @metadata ||= Coverage::Metadata.new(self) end |
#status ⇒ Object
29 30 31 32 33 34 |
# File 'lib/gitlab/ci/badge/coverage/report.rb', line 29 def status @coverage ||= raw_coverage return unless @coverage @coverage.round(2) end |