Class: Tilt::RedClothTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/sinatra/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, #compile, #eval_file, #initialize, #name, #render

Constructor Details

This class inherits a constructor from Tilt::Template

Instance Method Details

#compile!Object



428
429
430
# File 'lib/sinatra/tilt.rb', line 428

def compile!
  @engine = RedCloth.new(data)
end

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



432
433
434
# File 'lib/sinatra/tilt.rb', line 432

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

#initialize_engineObject



424
425
426
# File 'lib/sinatra/tilt.rb', line 424

def initialize_engine
  require_template_library 'redcloth' unless defined? ::RedCloth
end