Class: Representative::Tilt::NokogiriTemplate

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/representative/tilt_integration.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



16
17
18
19
20
21
# File 'lib/representative/tilt_integration.rb', line 16

def evaluate(scope, locals, &block)
  r = Representative::Nokogiri.new
  locals[:r] = r
  super(scope, locals, &block)
  r.to_xml
end

#initialize_engineObject



8
9
10
11
# File 'lib/representative/tilt_integration.rb', line 8

def initialize_engine
  return if defined?(Representative::Nokogiri)
  require_template_library 'representative/nokogiri'
end

#precompiled_template(locals) ⇒ Object



23
24
25
# File 'lib/representative/tilt_integration.rb', line 23

def precompiled_template(locals)
  data.to_str
end

#prepareObject



13
14
# File 'lib/representative/tilt_integration.rb', line 13

def prepare
end