Class: Gitlab::SecretDetection::Core::Finding
- Inherits:
-
Object
- Object
- Gitlab::SecretDetection::Core::Finding
- Defined in:
- lib/gitlab/secret_detection/core/finding.rb
Overview
Finding is a data object representing a secret finding identified within a payload
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
-
#payload_id ⇒ Object
readonly
Returns the value of attribute payload_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(payload_id, status, line_number = nil, type = nil, description = nil) ⇒ Finding
constructor
A new instance of Finding.
- #to_h ⇒ Object
Constructor Details
#initialize(payload_id, status, line_number = nil, type = nil, description = nil) ⇒ Finding
Returns a new instance of Finding.
10 11 12 13 14 15 16 |
# File 'lib/gitlab/secret_detection/core/finding.rb', line 10 def initialize(payload_id, status, line_number = nil, type = nil, description = nil) @payload_id = payload_id @status = status @line_number = line_number @type = type @description = description end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/gitlab/secret_detection/core/finding.rb', line 8 def description @description end |
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
8 9 10 |
# File 'lib/gitlab/secret_detection/core/finding.rb', line 8 def line_number @line_number end |
#payload_id ⇒ Object (readonly)
Returns the value of attribute payload_id.
8 9 10 |
# File 'lib/gitlab/secret_detection/core/finding.rb', line 8 def payload_id @payload_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/gitlab/secret_detection/core/finding.rb', line 8 def status @status end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/gitlab/secret_detection/core/finding.rb', line 8 def type @type end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/gitlab/secret_detection/core/finding.rb', line 18 def ==(other) self.class == other.class && other.state == state end |
#to_h ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/gitlab/secret_detection/core/finding.rb', line 22 def to_h { payload_id:, status:, line_number:, type:, description: } end |