Class: Giter8::Renderer::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/giter8/renderer/executor.rb

Overview

Executor implements methods for rendering remplates

Instance Method Summary collapse

Constructor Details

#initialize(props) ⇒ Executor

Initializes the executor with a given Pairs set



9
10
11
# File 'lib/giter8/renderer/executor.rb', line 9

def initialize(props)
  @props = props
end

Instance Method Details

#exec(tree) ⇒ Object

Returns a string after rendering the provided AST tree with the Pairs provided upon initialisation



15
16
17
18
19
# File 'lib/giter8/renderer/executor.rb', line 15

def exec(tree)
  result = StringIO.new
  exec_tree(tree, result)
  result.string
end