Class: GitlabChecks::Findings::Finding
- Inherits:
-
Object
- Object
- GitlabChecks::Findings::Finding
- Defined in:
- lib/gitlab_checks/findings/finding.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(_severity, _title, _description) ⇒ Finding
constructor
A new instance of Finding.
- #print_console ⇒ Object
- #severity_to_string(severity) ⇒ Object
Constructor Details
#initialize(_severity, _title, _description) ⇒ Finding
Returns a new instance of Finding.
9 10 11 12 13 |
# File 'lib/gitlab_checks/findings/finding.rb', line 9 def initialize(_severity, _title, _description) @severity = _severity @title = _title @description = _description end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
25 26 27 |
# File 'lib/gitlab_checks/findings/finding.rb', line 25 def description @description end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
25 26 27 |
# File 'lib/gitlab_checks/findings/finding.rb', line 25 def severity @severity end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
25 26 27 |
# File 'lib/gitlab_checks/findings/finding.rb', line 25 def title @title end |
Instance Method Details
#print_console ⇒ Object
19 20 21 22 23 |
# File 'lib/gitlab_checks/findings/finding.rb', line 19 def print_console puts "(#{severity_to_string(@severity)}) - #{@title}" puts " #{@description}" puts "" end |
#severity_to_string(severity) ⇒ Object
15 16 17 |
# File 'lib/gitlab_checks/findings/finding.rb', line 15 def severity_to_string(severity) SEVERITY.key(severity) end |