lib/clamsy/tenjin.rb
def render(template_name, context=Context.new, layout=true)
        #context = Context.new(context) if context.is_a?(Hash)
        context = hook_context(context)
        while true
          template = get_template(template_name, context)  # context is passed only for preprocessor
          _buf = context._buf
          output = template.render(context)
          context._buf = _buf
          unless context._layout.nil?
            layout = context._layout
            context._layout = nil
          end
          layout = @layout if layout == true or layout.nil?
          break unless layout
          template_name = layout
          layout = false
          context.instance_variable_set('@_content', output)
        end
        return output
      end
## get template object and evaluate it with context object.
## if argument 'layout' is true then default layout file (specified at
## initializer) is used as layout template, else if false then no layout
## template is used.
## if argument 'layout' is string, it is regarded as layout template name.
get template object and evaluate it with context object.
if argument 'layout' is true then default layout file (specified at
initializer) is used as layout template, else if false then no layout
template is used.
if argument 'layout' is string, it is regarded as layout template name.
get template object and evaluate it with context object . if argument ' layout ' is true then default layout file ( specified at initializer ) is used as layout template else if false then no layout template is used . if argument ' layout ' is string it is regarded as layout template name .
def render(template_name, context=Context.new, layout=true)
        context = hook_context(context)
        while true
          template = get_template(template_name, context)  
          _buf = context._buf
          output = template.render(context)
          context._buf = _buf
          unless context._layout.nil?
            layout = context._layout
            context._layout = nil
          end
          layout = @layout if layout == true or layout.nil?
          break unless layout
          template_name = layout
          layout = false
          context.instance_variable_set('@_content', output)
        end
        return output
      end
def render ( template_name , context = Context . new , layout = true ) context = hook_context ( context ) while true template = get_template ( template_name , context ) _buf = context . _buf output = template . render ( context ) context . _buf = _buf unless context . _layout . nil? layout = context . _layout context . _layout = nil end layout = @layout if layout == true or layout . nil? break unless layout template_name = layout layout = false context . instance_variable_set ( '@_content' , output ) end return output end
get template object and evaluate it with context object.
get template object and evaluate it with context object .
#context = Context.new(context) if context.is_a?(Hash) # context is passed only for preprocessor
template_name
context
new
layout