Sha256: 3df4e70d3b5aa54c2e770660ef9d3d5545d171d1d849a99518617cdd52793b2a

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

module Stache
  module Mustache
    class FasterContext < ::Mustache::Context

      def partial(name, indentation = nil)
        # Look for the first Mustache in the stack.
        mustache = mustache_in_stack

        # Do NOT indent the partial template by the given indentation.
        part = mustache.partial(name)

        # If we already have a template, to not convert it into a string
        part = part.to_s unless part.is_a?(::Mustache::Template)

        # Call the Mustache's `partial` method and render the result.
        mustache.render(part, self)
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stache-1.1.0 lib/stache/mustache/faster_context.rb