Class: Rails::Guarddog::Finding

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/guarddog/finding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(severity:, category:, message:, file:, line:, code_snippet: "", remediation: "") ⇒ Finding

Returns a new instance of Finding.



6
7
8
9
10
11
12
13
14
# File 'lib/rails/guarddog/finding.rb', line 6

def initialize(severity:, category:, message:, file:, line:, code_snippet: "", remediation: "")
  @severity = severity
  @category = category
  @message = message
  @file = file
  @line = line
  @code_snippet = code_snippet
  @remediation = remediation
end

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



4
5
6
# File 'lib/rails/guarddog/finding.rb', line 4

def category
  @category
end

#code_snippetObject

Returns the value of attribute code_snippet.



4
5
6
# File 'lib/rails/guarddog/finding.rb', line 4

def code_snippet
  @code_snippet
end

#fileObject

Returns the value of attribute file.



4
5
6
# File 'lib/rails/guarddog/finding.rb', line 4

def file
  @file
end

#lineObject

Returns the value of attribute line.



4
5
6
# File 'lib/rails/guarddog/finding.rb', line 4

def line
  @line
end

#messageObject

Returns the value of attribute message.



4
5
6
# File 'lib/rails/guarddog/finding.rb', line 4

def message
  @message
end

#remediationObject

Returns the value of attribute remediation.



4
5
6
# File 'lib/rails/guarddog/finding.rb', line 4

def remediation
  @remediation
end

#severityObject

Returns the value of attribute severity.



4
5
6
# File 'lib/rails/guarddog/finding.rb', line 4

def severity
  @severity
end

Instance Method Details

#to_hObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rails/guarddog/finding.rb', line 16

def to_h
  {
    severity: severity,
    category: category,
    message: message,
    file: file,
    line: line,
    code_snippet: code_snippet,
    remediation: remediation
  }
end