Class: Gitlab::Ci::Reports::Security::Locations::Base

Inherits:
Object
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/ci/reports/security/locations/base.rb

Direct Known Subclasses

Sast, SecretDetection

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



11
12
13
# File 'lib/gitlab/ci/reports/security/locations/base.rb', line 11

def ==(other)
  other.fingerprint == fingerprint
end

#as_json(options = nil) ⇒ Object



21
22
23
24
25
# File 'lib/gitlab/ci/reports/security/locations/base.rb', line 21

def as_json(options = nil)
  fingerprint # side-effect call to initialize the ivar for serialization

  super
end

#fingerprintObject



15
16
17
18
19
# File 'lib/gitlab/ci/reports/security/locations/base.rb', line 15

def fingerprint
  strong_memoize(:fingerprint) do
    Digest::SHA1.hexdigest(fingerprint_data)
  end
end

#fingerprint_pathObject



27
28
29
# File 'lib/gitlab/ci/reports/security/locations/base.rb', line 27

def fingerprint_path
  fingerprint_data
end