Class Tilt::NokogiriTemplate
In: lib/tilt.rb
Parent: Template

Nokogiri template implementation. See: nokogiri.org/

Methods

Public Instance methods

[Source]

     # File lib/tilt.rb, line 640
640:     def evaluate(scope, locals, &block)
641:       xml = ::Nokogiri::XML::Builder.new
642:       if data.respond_to?(:to_str)
643:         locals[:xml] = xml
644:         super(scope, locals, &block)
645:       elsif data.kind_of?(Proc)
646:         data.call(xml)
647:       end
648:       xml.to_xml
649:     end

[Source]

     # File lib/tilt.rb, line 633
633:     def initialize_engine
634:       return if defined?(::Nokogiri)
635:       require_template_library 'nokogiri'
636:     end

[Source]

     # File lib/tilt.rb, line 651
651:     def precompiled_template(locals)
652:       data.to_str
653:     end

[Source]

     # File lib/tilt.rb, line 638
638:     def prepare; end

[Validate]