Class: Reactive::Mvc::View::TemplateHandlers::Builder

Inherits:
Reactive::Mvc::View::TemplateHandler show all
Defined in:
lib/reactive-mvc/view/template_handlers/builder.rb

Instance Method Summary collapse

Methods inherited from Reactive::Mvc::View::TemplateHandler

call

Instance Method Details

#compile(template) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/reactive-mvc/view/template_handlers/builder.rb', line 6

def compile(template)
  "_set_controller_content_type(Mime::XML);" +
    "xml = ::Builder::XmlMarkup.new(:indent => 2);" +
    "self.output_buffer = xml.target!;" +
    template.source +
    ";xml.target!;"
end