Class: Gitlab::Ci::Reports::Security::FindingKey
- Inherits:
-
Object
- Object
- Gitlab::Ci::Reports::Security::FindingKey
- Defined in:
- lib/gitlab/ci/reports/security/finding_key.rb
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(location_fingerprint:, identifier_fingerprint:) ⇒ FindingKey
constructor
A new instance of FindingKey.
Constructor Details
#initialize(location_fingerprint:, identifier_fingerprint:) ⇒ FindingKey
Returns a new instance of FindingKey.
8 9 10 11 |
# File 'lib/gitlab/ci/reports/security/finding_key.rb', line 8 def initialize(location_fingerprint:, identifier_fingerprint:) @location_fingerprint = location_fingerprint @identifier_fingerprint = identifier_fingerprint end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
13 14 15 16 17 18 19 |
# File 'lib/gitlab/ci/reports/security/finding_key.rb', line 13 def ==(other) return false unless other.is_a?(self.class) has_fingerprints? && other.has_fingerprints? && location_fingerprint == other.location_fingerprint && identifier_fingerprint == other.identifier_fingerprint end |
#hash ⇒ Object
21 22 23 |
# File 'lib/gitlab/ci/reports/security/finding_key.rb', line 21 def hash location_fingerprint.hash ^ identifier_fingerprint.hash end |