Class: Tilt::RedClothTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/frank/tilt.rb

Overview

RedCloth implementation. See: redcloth.org/

Instance Attribute Summary

Attributes inherited from Template

#data, #file, #line, #options

Instance Method Summary collapse

Methods inherited from Template

#basename, #eval_file, #initialize, #name, #render

Constructor Details

This class inherits a constructor from Tilt::Template

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



662
663
664
# File 'lib/frank/tilt.rb', line 662

def evaluate(scope, locals, &block)
  @output ||= @engine.to_html
end

#initialize_engineObject



652
653
654
655
# File 'lib/frank/tilt.rb', line 652

def initialize_engine
  return if defined? ::RedCloth
  require_template_library 'redcloth'
end

#prepareObject



657
658
659
660
# File 'lib/frank/tilt.rb', line 657

def prepare
  @engine = RedCloth.new(data)
  @output = nil
end