Class: Nanoc::Core::ActionSequenceStore Private
- Includes:
- ContractsSupport
- Defined in:
- lib/nanoc/core/action_sequence_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 action sequences 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 action sequence for the given object.
- #[]=(obj, action_sequence) ⇒ void private
-
#initialize(config:) ⇒ ActionSequenceStore
constructor
private
A new instance of ActionSequenceStore.
Methods included from ContractsSupport
enabled?, included, setup_once, warn_about_performance
Methods inherited from Store
#load, #store, tmp_path_for, tmp_path_prefix
Constructor Details
#initialize(config:) ⇒ ActionSequenceStore
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 ActionSequenceStore.
13 14 15 16 17 |
# File 'lib/nanoc/core/action_sequence_store.rb', line 13 def initialize(config:) super(Nanoc::Core::Store.tmp_path_for(config:, store_name: 'rule_memory'), 2) @action_sequences = {} 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 action sequence for the given object.
23 24 25 |
# File 'lib/nanoc/core/action_sequence_store.rb', line 23 def [](obj) @action_sequences[obj.reference] end |
#[]=(obj, action_sequence) ⇒ 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.
33 34 35 |
# File 'lib/nanoc/core/action_sequence_store.rb', line 33 def []=(obj, action_sequence) @action_sequences[obj.reference] = action_sequence end |