Sha256: 1e3eae2715836e4430b69c4cdcbf291fddea925c5e6bd7a1a8135775fe695020

Contents?: true

Size: 486 Bytes

Versions: 8

Compression:

Stored size: 486 Bytes

Contents

# encoding: utf-8

require "rango" # logger
require "rango/templates/template"

module Rango
  module RenderMixin
    extend self # so you can use Rango::RenderMixin.render

    # @since 0.0.2
    def render(path, scope = Object.new, context = Hash.new)
      scope, context = Object.new, scope if context.empty? && scope.is_a?(Hash)
      #Rango.logger.inspect(context: context)
      template = Rango::Template.new(path, scope)
      return template.render(context)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rango-0.2.6 lib/rango/mixins/render.rb
rango-0.2.5.1 lib/rango/mixins/render.rb
rango-0.2.4.1 lib/rango/mixins/render.rb
rango-0.2.3 lib/rango/mixins/render.rb
rango-0.2.1 lib/rango/mixins/render.rb
rango-0.2.1.pre lib/rango/mixins/render.rb
rango-0.2 lib/rango/mixins/render.rb
rango-0.2.pre lib/rango/mixins/render.rb