Class: Nanoc::Int::RuleMemoryStore Private

Inherits:
Store
  • Object
show all
Defined in:
lib/nanoc/base/repos/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

#filename, #version

Instance Method Summary collapse

Methods inherited from Store

#load, #no_data_found, #store, #version_mismatch_detected

Constructor Details

#initializeRuleMemoryStore

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.



7
8
9
10
11
# File 'lib/nanoc/base/repos/rule_memory_store.rb', line 7

def initialize
  super('tmp/rule_memory', 1)

  @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.

Parameters:

Returns:

  • (Array)

    The rule memory for the given object



17
18
19
# File 'lib/nanoc/base/repos/rule_memory_store.rb', line 17

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.

Parameters:



27
28
29
# File 'lib/nanoc/base/repos/rule_memory_store.rb', line 27

def []=(obj, rule_memory)
  @rule_memories[obj.reference] = rule_memory
end