Class: Magma::Templater

Inherits:
Object
  • Object
show all
Includes:
Common, Utils
Defined in:
lib/magma/templater.rb

Instance Method Summary collapse

Methods included from Utils

#pipe, #read_file_or_stdin, #run, #symbolize_keys, #uuid?, #which

Methods included from Common

#handle_output!

Constructor Details

#initialize(infile, options) ⇒ Templater

Returns a new instance of Templater.



12
13
14
15
# File 'lib/magma/templater.rb', line 12

def initialize(infile, options)
  @infile   = infile
  @options  = options
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/magma/templater.rb', line 17

def call
  pipe source, [
    :template,
    :render,
    :parse,
    :transform,
    '.to_xml',
    ->(result) { handle_output!(result, options.merge(infile: infile)) },
  ]
end