Stores rule memories for objects that can be run through a rule (item representations and layouts).
@api private
@option params [Nanoc::Site] site The site where this rule memory store
belongs to
# File lib/nanoc/base/compilation/rule_memory_store.rb, line 12 def initialize(params={}) super('tmp/rule_memory', 1) @site = params[:site] if params.has_key?(:site) @rule_memories = {} end
@param [Nanoc::ItemRep, Nanoc::Layout] obj The item representation or
the layout to get the rule memory for
@return [Array] The rule memory for the given object
# File lib/nanoc/base/compilation/rule_memory_store.rb, line 24 def [](obj) @rule_memories[obj.reference] end
@param [Nanoc::ItemRep, Nanoc::Layout] obj The item representation or
the layout to set the rule memory for
@param [Array] rule_memory The new rule memory to be stored
@return [void]
# File lib/nanoc/base/compilation/rule_memory_store.rb, line 34 def []=(obj, rule_memory) @rule_memories[obj.reference] = rule_memory end
@see Nanoc::Store#data
# File lib/nanoc/base/compilation/rule_memory_store.rb, line 41 def data @rule_memories end
@see Nanoc::Store#data=
# File lib/nanoc/base/compilation/rule_memory_store.rb, line 46 def data=(new_data) @rule_memories = new_data end
Generated with the Darkfish Rdoc Generator 2.