Class: Mack::Rendering::Engine::Builder

Inherits:
Base show all
Defined in:
lib/mack/rendering/engine/builder.rb

Overview

Allows use of the Builder::XmlMarkup engine to be used with rendering.

Defined Under Namespace

Modules: ViewTemplateHelpers

Instance Attribute Summary

Attributes inherited from Base

#view_template

Instance Method Summary collapse

Methods inherited from Base

#capture, #initialize

Constructor Details

This class inherits a constructor from Mack::Rendering::Engine::Base

Instance Method Details

#extensionObject



18
19
20
# File 'lib/mack/rendering/engine/builder.rb', line 18

def extension
  :builder
end

#render(io, binding) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/mack/rendering/engine/builder.rb', line 9

def render(io, binding)
  if io.is_a?(File)
    io = io.read
  end
  @_xml = ::Builder::XmlMarkup.new(:target => @_xml_output, :indent => 1)
  view_template.instance_variable_set("@_xml", @_xml)
  eval(io, binding)
end