| Class | Puppet::Checksum |
| In: |
lib/puppet/checksum.rb
|
| Parent: | Object |
| algorithm | [R] | |
| content | [R] |
# File lib/puppet/checksum.rb, line 38
38: def initialize(content, algorithm = "md5")
39: raise ArgumentError.new("You must specify the content") unless content
40:
41: @content = content
42:
43: # Init to avoid warnings.
44: @checksum = nil
45:
46: self.algorithm = algorithm
47: end
# File lib/puppet/checksum.rb, line 20
20: def algorithm=(value)
21: unless respond_to?(value)
22: raise ArgumentError, "Checksum algorithm %s is not supported" % value
23: end
24: value = value.intern if value.is_a?(String)
25: @algorithm = value
26: # Reset the checksum so it's forced to be recalculated.
27: @checksum = nil
28: end
This is here so the Indirector::File terminus works correctly.
# File lib/puppet/checksum.rb, line 50
50: def name
51: checksum
52: end