Class: Nanoc3::RuleMemoryStore Private
- Defined in:
- lib/nanoc3/base/compilation/rule_memory_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 rule memories for objects that can be run through a rule (item representations and layouts).
Instance Attribute Summary
Attributes inherited from Store
Instance Method Summary collapse
-
#[](obj) ⇒ Array
private
The rule memory for the given object.
- #[]=(obj, rule_memory) ⇒ void private
-
#initialize(params = {}) ⇒ RuleMemoryStore
constructor
private
A new instance of RuleMemoryStore.
Methods inherited from Store
#load, #no_data_found, #store, #unload, #version_mismatch_detected
Constructor Details
#initialize(params = {}) ⇒ RuleMemoryStore
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 RuleMemoryStore.
13 14 15 16 17 18 19 |
# File 'lib/nanoc3/base/compilation/rule_memory_store.rb', line 13 def initialize(params={}) super('tmp/rule_memory', 1) @site = params[:site] if params.has_key?(:site) @rule_memories = {} end |
Instance Method Details
#[](obj) ⇒ Array
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 rule memory for the given object.
25 26 27 |
# File 'lib/nanoc3/base/compilation/rule_memory_store.rb', line 25 def [](obj) @rule_memories[obj.reference] end |
#[]=(obj, rule_memory) ⇒ void
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.
This method returns an undefined value.
35 36 37 |
# File 'lib/nanoc3/base/compilation/rule_memory_store.rb', line 35 def []=(obj, rule_memory) @rule_memories[obj.reference] = rule_memory end |