Class: DockerDistribution::DigestSet
- Inherits:
-
Object
- Object
- DockerDistribution::DigestSet
- Defined in:
- lib/docker_distribution/digest_set.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #add(digest_string) ⇒ Object
-
#initialize(digest_strings) ⇒ DigestSet
constructor
A new instance of DigestSet.
- #lookup!(digest_string) ⇒ Object
Constructor Details
Instance Attribute Details
#entries ⇒ Object
13 14 15 |
# File 'lib/docker_distribution/digest_set.rb', line 13 def entries @entries ||= [] end |
Instance Method Details
#add(digest_string) ⇒ Object
17 18 19 |
# File 'lib/docker_distribution/digest_set.rb', line 17 def add(digest_string) @entries << Digest.new(digest_string) end |
#lookup!(digest_string) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/docker_distribution/digest_set.rb', line 21 def lookup!(digest_string) raise DigestNotFound if entries.length.zero? search_func, encoded, alg = parse!(digest_string) entry = search(search_func, encoded, alg) entry.digest end |