Class: Runbook::Statement

Inherits:
Node
  • Object
show all
Includes:
Hooks::Invoker
Defined in:
lib/runbook/statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Hooks::Invoker

#_execute_after_hooks, #_execute_around_hooks, #_execute_before_hooks, #invoke_with_hooks

Methods inherited from Node

#dynamic!, #dynamic?, #initialize, #visited!, #visited?

Constructor Details

This class inherits a constructor from Runbook::Node

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



5
6
7
# File 'lib/runbook/statement.rb', line 5

def parent
  @parent
end

Instance Method Details

#render(view, output, metadata) ⇒ Object



7
8
9
10
11
# File 'lib/runbook/statement.rb', line 7

def render(view, output, )
  invoke_with_hooks(view, self, output, ) do
    view.render(self, output, )
  end
end

#run(run, metadata) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/runbook/statement.rb', line 13

def run(run, )
  return if dynamic? && visited?

  invoke_with_hooks(run, self, ) do
    run.execute(self, )
  end
  self.visited!
end