Class: Longleaf::ManifestDigestProvider
- Inherits:
-
Object
- Object
- Longleaf::ManifestDigestProvider
- Defined in:
- lib/longleaf/candidates/manifest_digest_provider.rb
Overview
Provides digests for files from a manifest
Instance Method Summary collapse
-
#get_digests(file_path) ⇒ Object
Hash containing all the manifested digests for the given path, or nil.
-
#initialize(digests_mapping) ⇒ ManifestDigestProvider
constructor
A new instance of ManifestDigestProvider.
Constructor Details
#initialize(digests_mapping) ⇒ ManifestDigestProvider
Returns a new instance of ManifestDigestProvider.
5 6 7 |
# File 'lib/longleaf/candidates/manifest_digest_provider.rb', line 5 def initialize(digests_mapping) @digests_mapping = digests_mapping end |
Instance Method Details
#get_digests(file_path) ⇒ Object
Returns hash containing all the manifested digests for the given path, or nil.
11 12 13 14 15 |
# File 'lib/longleaf/candidates/manifest_digest_provider.rb', line 11 def get_digests(file_path) # return nil if key not found, in case the hash has default values return nil unless @digests_mapping.key?(file_path) @digests_mapping[file_path] end |