Class: Nanoc3::ChecksumStore Private
- Defined in:
- lib/nanoc3/base/compilation/checksum_store.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Stores checksums for objects in order to be able to detect whether a file has changed since the last site compilation.
Instance Attribute Summary
Attributes inherited from Store
Instance Method Summary collapse
-
#[](obj) ⇒ String
private
Returns the old checksum for the given object.
-
#[]=(obj, checksum) ⇒ Object
private
Sets the checksum for the given object.
-
#initialize(params = {}) ⇒ ChecksumStore
constructor
private
A new instance of ChecksumStore.
- #unload ⇒ Object private
Methods inherited from Store
#load, #no_data_found, #store, #version_mismatch_detected
Constructor Details
#initialize(params = {}) ⇒ ChecksumStore
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ChecksumStore.
13 14 15 16 17 18 19 |
# File 'lib/nanoc3/base/compilation/checksum_store.rb', line 13 def initialize(params={}) super('tmp/checksums', 1) @site = params[:site] if params.has_key?(:site) @checksums = {} end |
Instance Method Details
#[](obj) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the old checksum for the given object. This makes sense for items, layouts and code snippets.
27 28 29 |
# File 'lib/nanoc3/base/compilation/checksum_store.rb', line 27 def [](obj) @checksums[obj.reference] end |
#[]=(obj, checksum) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sets the checksum for the given object.
36 37 38 |
# File 'lib/nanoc3/base/compilation/checksum_store.rb', line 36 def []=(obj, checksum) @checksums[obj.reference] = checksum end |
#unload ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/nanoc3/base/compilation/checksum_store.rb', line 41 def unload @checksums = {} end |