Public Instance methods
evaluate(scope, locs)
[show source]
# File lib/tilt/liquid.rb 78 def evaluate(scope, locs) 79 locals = {} 80 if scope.respond_to?(:to_h) 81 scope.to_h.each{|k, v| locals[k.to_s] = v} 82 end 83 locs.each{|k, v| locals[k.to_s] = v} 84 locals['yield'] = block_given? ? yield : '' 85 locals['content'] = locals['yield'] 86 @engine.render(locals) 87 end
prepare()
[show source]
# File lib/tilt/liquid.rb 73 def prepare 74 @options[:line_numbers] = true unless @options.has_key?(:line_numbers) 75 @engine = ::Liquid::Template.parse(@data, @options) 76 end