Method: Cumuliform::Runner.process_io

Defined in:
lib/cumuliform/runner.rb

.process_io(io) ⇒ Template

Processes an IO object which will, when read, return a Cumuliform template file.

Parameters:

  • io (IO)

    The IO-like object containing the template

Returns:

  • (Template)

    the parsed Cumuliform::Template object



13
14
15
16
17
18
# File 'lib/cumuliform/runner.rb', line 13

def self.process_io(io)
  mod = Module.new
  path = io.respond_to?(:path) ? io.path : nil
  args = [io.read, path].compact
  template = mod.class_eval(*args)
end