Sha256: 5f529907112e07fa221e226ec3861ba5cb7ca677619378b934908de6ed676697

Contents?: true

Size: 500 Bytes

Versions: 11

Compression:

Stored size: 500 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, context = Object.new, locals = Hash.new)
      context, locals = Object.new, context if locals.empty? && context.is_a?(Hash)
      Rango.logger.inspect(locals: locals)
      template = Rango::Templates::Template.new(path, context)
      return template.render(locals)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rango-0.1.1.2.10 lib/rango/mixins/render.rb
rango-0.1.1.2.9 lib/rango/mixins/render.rb
rango-0.1.1.2.8 lib/rango/mixins/render.rb
rango-0.1.1.2.7 lib/rango/mixins/render.rb
rango-0.1.1.2.6 lib/rango/mixins/render.rb
rango-0.1.1.2.5 lib/rango/mixins/render.rb
rango-0.1.1.2.4 lib/rango/mixins/render.rb
rango-0.1.1.2.3 lib/rango/mixins/render.rb
rango-0.1.1.2.2 lib/rango/mixins/render.rb
rango-0.1.1.2.1 lib/rango/mixins/render.rb
rango-0.1.1.2 lib/rango/mixins/render.rb