Class: Nanoc::Core::ChecksumCollection

Inherits:
Object
  • Object
show all
Includes:
ContractsSupport
Defined in:
lib/nanoc/core/checksum_collection.rb

Instance Method Summary collapse

Methods included from ContractsSupport

enabled?, included, setup_once, warn_about_performance

Constructor Details

#initialize(checksums) ⇒ ChecksumCollection

Returns a new instance of ChecksumCollection.



10
11
12
# File 'lib/nanoc/core/checksum_collection.rb', line 10

def initialize(checksums)
  @checksums = checksums
end

Instance Method Details

#attributes_checksum_for(obj) ⇒ Object



25
26
27
# File 'lib/nanoc/core/checksum_collection.rb', line 25

def attributes_checksum_for(obj)
  @checksums[[obj.reference, :each_attribute]]
end

#checksum_for(obj) ⇒ Object



15
16
17
# File 'lib/nanoc/core/checksum_collection.rb', line 15

def checksum_for(obj)
  @checksums[obj.reference]
end

#content_checksum_for(obj) ⇒ Object



20
21
22
# File 'lib/nanoc/core/checksum_collection.rb', line 20

def content_checksum_for(obj)
  @checksums[[obj.reference, :content]]
end

#to_hObject



29
30
31
# File 'lib/nanoc/core/checksum_collection.rb', line 29

def to_h
  @checksums
end