class Tilt::HamlTemplate

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source
Calls superclass method
   # File lib/tilt/haml.rb
28 def evaluate(scope, locals, &block)
29   raise ArgumentError, 'invalid scope: must not be frozen' if scope.frozen?
30   super
31 end
precompiled_postamble(locals) click to toggle source
   # File lib/tilt/haml.rb
81         def precompiled_postamble(locals)
82           @engine.instance_eval do
83             <<-RUBY
84                 #{precompiled_method_return_value}
85               ensure
86                 @haml_buffer = @haml_buffer.upper if haml_buffer
87               end
88             RUBY
89           end
90         end
precompiled_preamble(locals) click to toggle source
Calls superclass method
   # File lib/tilt/haml.rb
66         def precompiled_preamble(locals)
67           local_assigns = super
68           @engine.instance_eval do
69             <<-RUBY
70               begin
71                 extend Haml::Helpers
72                 _hamlout = @haml_buffer = Haml::Buffer.new(haml_buffer, #{options_for_buffer.inspect})
73                 _erbout = _hamlout.buffer
74                 __in_erb_template = true
75                 _haml_locals = locals
76                 #{local_assigns}
77             RUBY
78           end
79         end
precompiled_template(locals) click to toggle source
   # File lib/tilt/haml.rb
33         def precompiled_template(locals)
34           @engine.precompiled_with_ambles(
35             [],
36             after_preamble: <<-RUBY
37               __in_erb_template = true
38               _haml_locals = locals
39             RUBY
40           )
41         end
prepare() click to toggle source
   # File lib/tilt/haml.rb
17 def prepare
18   @options[:filename] = eval_file
19   @options[:line] = @line
20   if @options.include?(:outvar)
21     @options[:buffer] = @options.delete(:outvar)
22     @options[:save_buffer] = true
23   end
24   @engine = ::Haml::TempleEngine.new(@options)
25   @engine.compile(@data)
26 end