Class: Nanoc::Int::ActionSequenceBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/base/services/action_sequence_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(item_rep) ⇒ ActionSequenceBuilder

Returns a new instance of ActionSequenceBuilder



7
8
9
10
# File 'lib/nanoc/base/services/action_sequence_builder.rb', line 7

def initialize(item_rep)
  @item_rep = item_rep
  @actions = []
end

Instance Method Details

#action_sequenceObject



32
33
34
# File 'lib/nanoc/base/services/action_sequence_builder.rb', line 32

def action_sequence
  Nanoc::Int::ActionSequence.new(@item_rep, actions: @actions)
end

#add_filter(filter_name, params) ⇒ Object



13
14
15
16
# File 'lib/nanoc/base/services/action_sequence_builder.rb', line 13

def add_filter(filter_name, params)
  @actions << Nanoc::Int::ProcessingActions::Filter.new(filter_name, params)
  self
end

#add_layout(layout_identifier, params) ⇒ Object



19
20
21
22
# File 'lib/nanoc/base/services/action_sequence_builder.rb', line 19

def add_layout(layout_identifier, params)
  @actions << Nanoc::Int::ProcessingActions::Layout.new(layout_identifier, params)
  self
end

#add_snapshot(snapshot_name, path) ⇒ Object



25
26
27
28
29
# File 'lib/nanoc/base/services/action_sequence_builder.rb', line 25

def add_snapshot(snapshot_name, path)
  will_add_snapshot(snapshot_name)
  @actions << Nanoc::Int::ProcessingActions::Snapshot.new([snapshot_name], path ? [path] : [])
  self
end