Builder template implementation.
Public Instance methods
evaluate(scope, locals, &block)
[show source]
# File lib/tilt/builder.rb 18 def evaluate(scope, locals, &block) 19 if @data.respond_to?(:to_str) 20 unless locals[:xml] 21 locals = Hash[locals] 22 locals[:xml] = xml_builder 23 end 24 return super 25 end 26 27 xml = locals[:xml] || xml_builder 28 @data.call(xml) 29 xml.target! 30 end
precompiled_postamble(locals)
[show source]
# File lib/tilt/builder.rb 32 def precompiled_postamble(locals) 33 "xml.target!" 34 end
precompiled_template(locals)
[show source]
# File lib/tilt/builder.rb 36 def precompiled_template(locals) 37 @data.to_str 38 end