Class: GitlabChecks::Findings::Finding

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab_checks/findings/finding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



25
26
27
# File 'lib/gitlab_checks/findings/finding.rb', line 25

def description
  @description
end

#severityObject (readonly)

Returns the value of attribute severity.



25
26
27
# File 'lib/gitlab_checks/findings/finding.rb', line 25

def severity
  @severity
end

#titleObject (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



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