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