Class: Nanoc::Core::ChecksumCollection
- Inherits:
-
Object
- Object
- Nanoc::Core::ChecksumCollection
show all
- Includes:
- ContractsSupport
- Defined in:
- lib/nanoc/core/checksum_collection.rb
Instance Method Summary
collapse
enabled?, included, setup_once, warn_about_performance
Constructor Details
Returns a new instance of ChecksumCollection.
14
15
16
17
18
|
# File 'lib/nanoc/core/checksum_collection.rb', line 14
def initialize(checksums)
@checksums = checksums
@_attribute_checksums = {}
end
|
Instance Method Details
#attributes_checksum_for(obj) ⇒ Object
31
32
33
34
|
# File 'lib/nanoc/core/checksum_collection.rb', line 31
def attributes_checksum_for(obj)
@_attribute_checksums[obj] ||=
@checksums[[obj.reference, :each_attribute]]
end
|
#checksum_for(obj) ⇒ Object
21
22
23
|
# File 'lib/nanoc/core/checksum_collection.rb', line 21
def checksum_for(obj)
@checksums[obj.reference]
end
|
#content_checksum_for(obj) ⇒ Object
26
27
28
|
# File 'lib/nanoc/core/checksum_collection.rb', line 26
def content_checksum_for(obj)
@checksums[[obj.reference, :content]]
end
|
#to_h ⇒ Object
36
37
38
|
# File 'lib/nanoc/core/checksum_collection.rb', line 36
def to_h
@checksums
end
|