Class: Nanoc3::ItemRepRecorderProxy Private
- Inherits:
-
Object
- Object
- Nanoc3::ItemRepRecorderProxy
- Extended by:
- Forwardable
- Defined in:
- lib/nanoc3/base/compilation/item_rep_recorder_proxy.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.
Represents a fake iem representation that does not actually perform any actual filtering, layouting or snapshotting, but instead keeps track of what would happen if a real item representation would have been used instead. It therefore “records” the actions that happens upon it.
The list of recorded actions is used during compilation to determine whether an item representation needs to be recompiled: if the list of actions is different from the list of actions from the previous compilation run, the item needs to be recompiled; if it is the same, it may not need to be recompiled.
Instance Attribute Summary collapse
-
#rule_memory ⇒ Array
readonly
private
The list of recorded actions (“rule memory”).
Instance Method Summary collapse
- #content ⇒ {} private
- #filter(name, args = {}) ⇒ void private
-
#initialize(item_rep) ⇒ ItemRepRecorderProxy
constructor
private
A new instance of ItemRepRecorderProxy.
-
#is_proxy? ⇒ true
private
Returns true because this item is already a proxy, and therefore doesn’t need to be wrapped anymore.
- #layout(layout_identifier) ⇒ void private
- #snapshot(snapshot_name, params = {}) ⇒ void private
Constructor Details
#initialize(item_rep) ⇒ ItemRepRecorderProxy
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 ItemRepRecorderProxy.
44 45 46 47 |
# File 'lib/nanoc3/base/compilation/item_rep_recorder_proxy.rb', line 44 def initialize(item_rep) @item_rep = item_rep @rule_memory = [] end |
Instance Attribute Details
#rule_memory ⇒ Array (readonly)
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 list of recorded actions (“rule memory”).
40 41 42 |
# File 'lib/nanoc3/base/compilation/item_rep_recorder_proxy.rb', line 40 def rule_memory @rule_memory end |
Instance Method Details
#content ⇒ {}
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.
71 72 73 |
# File 'lib/nanoc3/base/compilation/item_rep_recorder_proxy.rb', line 71 def content {} end |
#filter(name, args = {}) ⇒ 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.
52 53 54 |
# File 'lib/nanoc3/base/compilation/item_rep_recorder_proxy.rb', line 52 def filter(name, args={}) @rule_memory << [ :filter, name, args ] end |
#is_proxy? ⇒ true
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 true because this item is already a proxy, and therefore doesn’t need to be wrapped anymore.
82 83 84 |
# File 'lib/nanoc3/base/compilation/item_rep_recorder_proxy.rb', line 82 def is_proxy? true end |
#layout(layout_identifier) ⇒ 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.
59 60 61 |
# File 'lib/nanoc3/base/compilation/item_rep_recorder_proxy.rb', line 59 def layout(layout_identifier) @rule_memory << [ :layout, layout_identifier ] end |
#snapshot(snapshot_name, params = {}) ⇒ 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.
66 67 68 |
# File 'lib/nanoc3/base/compilation/item_rep_recorder_proxy.rb', line 66 def snapshot(snapshot_name, params={}) @rule_memory << [ :snapshot, snapshot_name, params ] end |