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, line 14
def evaluate(scope, locals, &block)
  xml = (locals[:xml] || ::Builder::XmlMarkup.new(options))

  if data.respond_to?(:to_str)
    if !locals[:xml]
      locals = locals.merge(:xml => xml)
    end
    return super(scope, locals, &block)
  end

  data.call(xml)
  xml.target!
end
precompiled_postamble(locals) click to toggle source
# File lib/tilt/builder.rb, line 28
def precompiled_postamble(locals)
  "xml.target!"
end
precompiled_template(locals) click to toggle source
# File lib/tilt/builder.rb, line 32
def precompiled_template(locals)
  data.to_str
end
prepare() click to toggle source
# File lib/tilt/builder.rb, line 10
def prepare
  options[:indent] ||= 2
end