Class: Faith::Sequence

Inherits:
Namespace show all
Defined in:
lib/faith/sequence.rb

Instance Attribute Summary

Attributes inherited from Namespace

#children

Attributes inherited from Task

#action, #dependencies, #mixins, #name, #parent

Instance Method Summary collapse

Methods inherited from Namespace

#resolve_self!

Methods inherited from Task

#child, #ensure_all_resolved, #ensure_resolved, #resolve, #resolve_self!, #run

Methods included from Named

#full_name, #root?

Constructor Details

#initialize(name, parent, children, mixins: [], dependencies: []) ⇒ Sequence

Returns a new instance of Sequence.



3
4
5
6
7
8
9
10
11
# File 'lib/faith/sequence.rb', line 3

def initialize(name, parent, children, mixins: [], dependencies: [])
  s = self
  super(name, parent, children, mixins: mixins, dependencies: dependencies) do |ctx|
    ctx.output.sequence(s)
    ctx.output.indent
    children.each { |child| child.run(ctx) }
    ctx.output.dedent
  end
end