class Tilt::BuilderTemplate

Builder template implementation. See: builder.rubyforge.org/

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source
Calls superclass method
   # File lib/tilt/builder.rb
14 def evaluate(scope, locals, &block)
15   xml = (locals[:xml] || ::Builder::XmlMarkup.new(options))
16 
17   if data.respond_to?(:to_str)
18     if !locals[:xml]
19       locals = locals.merge(:xml => xml)
20     end
21     return super(scope, locals, &block)
22   end
23 
24   data.call(xml)
25   xml.target!
26 end
precompiled_postamble(locals) click to toggle source
   # File lib/tilt/builder.rb
28 def precompiled_postamble(locals)
29   "xml.target!"
30 end
precompiled_template(locals) click to toggle source
   # File lib/tilt/builder.rb
32 def precompiled_template(locals)
33   data.to_str
34 end
prepare() click to toggle source
   # File lib/tilt/builder.rb
10 def prepare
11   options[:indent] ||= 2
12 end