Class: Nanoc::Core::ActionSequence
- Inherits:
-
Object
- Object
- Nanoc::Core::ActionSequence
show all
- Includes:
- Enumerable, ContractsSupport
- Defined in:
- lib/nanoc/core/action_sequence.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
enabled?, included, setup_once, warn_about_performance
Constructor Details
#initialize(item_rep, actions: []) ⇒ ActionSequence
Returns a new instance of ActionSequence.
13
14
15
16
|
# File 'lib/nanoc/core/action_sequence.rb', line 13
def initialize(item_rep, actions: [])
@item_rep = item_rep
@actions = actions
end
|
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
11
12
13
|
# File 'lib/nanoc/core/action_sequence.rb', line 11
def actions
@actions
end
|
#item_rep ⇒ Object
Returns the value of attribute item_rep.
10
11
12
|
# File 'lib/nanoc/core/action_sequence.rb', line 10
def item_rep
@item_rep
end
|
Instance Method Details
#[](idx) ⇒ Object
24
25
26
|
# File 'lib/nanoc/core/action_sequence.rb', line 24
def [](idx)
@actions[idx]
end
|
#each ⇒ Object
48
49
50
51
|
# File 'lib/nanoc/core/action_sequence.rb', line 48
def each
@actions.each { |a| yield(a) }
self
end
|
#map ⇒ Object
54
55
56
57
58
59
|
# File 'lib/nanoc/core/action_sequence.rb', line 54
def map
self.class.new(
@item_rep,
actions: @actions.map { |a| yield(a) },
)
end
|
#paths ⇒ Object
34
35
36
|
# File 'lib/nanoc/core/action_sequence.rb', line 34
def paths
snapshot_actions.map { |a| [a.snapshot_names, a.paths] }
end
|
#serialize_uncached ⇒ Object
43
44
45
|
# File 'lib/nanoc/core/action_sequence.rb', line 43
def serialize_uncached
to_a.map(&:serialize)
end
|
#size ⇒ Object
19
20
21
|
# File 'lib/nanoc/core/action_sequence.rb', line 19
def size
@actions.size
end
|
#snapshot_actions ⇒ Object