Class: Nanoc::Core::ActionSequenceBuilder
- Inherits:
-
Object
- Object
- Nanoc::Core::ActionSequenceBuilder
show all
- Includes:
- ContractsSupport
- Defined in:
- lib/nanoc/core/action_sequence_builder.rb
Defined Under Namespace
Classes: CannotCreateMultipleSnapshotsWithSameNameError
Class Method Summary
collapse
Instance Method Summary
collapse
enabled?, included, setup_once, warn_about_performance
Constructor Details
Returns a new instance of ActionSequenceBuilder.
26
27
28
|
# File 'lib/nanoc/core/action_sequence_builder.rb', line 26
def initialize
@actions = []
end
|
Class Method Details
.build {|builder| ... } ⇒ Object
20
21
22
23
24
|
# File 'lib/nanoc/core/action_sequence_builder.rb', line 20
def self.build
builder = new
yield(builder)
builder.action_sequence
end
|
Instance Method Details
#action_sequence ⇒ Object
55
56
57
|
# File 'lib/nanoc/core/action_sequence_builder.rb', line 55
def action_sequence
Nanoc::Core::ActionSequence.new(actions: @actions)
end
|
#add_filter(filter_name, params) ⇒ Object
31
32
33
34
35
36
|
# File 'lib/nanoc/core/action_sequence_builder.rb', line 31
def add_filter(filter_name, params)
@actions << Nanoc::Core::ProcessingActions::Filter.new(
filter_name, params
)
self
end
|
#add_layout(layout_identifier, params) ⇒ Object
39
40
41
42
43
44
|
# File 'lib/nanoc/core/action_sequence_builder.rb', line 39
def add_layout(layout_identifier, params)
@actions << Nanoc::Core::ProcessingActions::Layout.new(
layout_identifier, params
)
self
end
|
#add_snapshot(snapshot_name, path, rep) ⇒ Object
46
47
48
49
50
51
52
|
# File 'lib/nanoc/core/action_sequence_builder.rb', line 46
def add_snapshot(snapshot_name, path, rep)
will_add_snapshot(snapshot_name, rep)
@actions << Nanoc::Core::ProcessingActions::Snapshot.new(
[snapshot_name], path ? [path] : []
)
self
end
|