class Tilt::HamlTemplate

  1. lib/tilt/haml.rb
Superclass: Template

Public Instance methods

evaluate(scope, locals, &block)
[show source]
   # File lib/tilt/haml.rb
94 def evaluate(scope, locals, &block)
95   raise ArgumentError, 'invalid scope: must not be frozen' if scope.frozen?
96   super
97 end
precompiled_postamble(locals)
[show source]
    # File lib/tilt/haml.rb
147         def precompiled_postamble(locals)
148           @engine.instance_eval do
149             <<-RUBY
150                 #{precompiled_method_return_value}
151               ensure
152                 @haml_buffer = @haml_buffer.upper if haml_buffer
153               end
154             RUBY
155           end
156         end
precompiled_preamble(locals)
[show source]
    # File lib/tilt/haml.rb
132         def precompiled_preamble(locals)
133           local_assigns = super
134           @engine.instance_eval do
135             <<-RUBY
136               begin
137                 extend Haml::Helpers
138                 _hamlout = @haml_buffer = Haml::Buffer.new(haml_buffer, #{options_for_buffer.inspect})
139                 _erbout = _hamlout.buffer
140                 __in_erb_template = true
141                 _haml_locals = locals
142                 #{local_assigns}
143             RUBY
144           end
145         end
precompiled_template(locals)
[show source]
    # File lib/tilt/haml.rb
 99         def precompiled_template(locals)
100           @engine.precompiled_with_ambles(
101             [],
102             after_preamble: <<-RUBY
103               __in_erb_template = true
104               _haml_locals = locals
105             RUBY
106           )
107         end
prepare()
[show source]
   # File lib/tilt/haml.rb
83 def prepare
84   @options[:filename] = eval_file
85   @options[:line] = @line
86   if @options.include?(:outvar)
87     @options[:buffer] = @options.delete(:outvar)
88     @options[:save_buffer] = true
89   end
90   @engine = ::Haml::TempleEngine.new(@options)
91   @engine.compile(@data)
92 end