Class: Tilt::RedClothTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/tilt/redcloth.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, default_mime_type, default_mime_type=, #eval_file, #initialize, metadata, #metadata, #name, #render

Constructor Details

This class inherits a constructor from Tilt::Template

Instance Method Details

#allows_script?Boolean



18
19
20
# File 'lib/tilt/redcloth.rb', line 18

def allows_script?
  false
end

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



14
15
16
# File 'lib/tilt/redcloth.rb', line 14

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

#prepareObject



8
9
10
11
12
# File 'lib/tilt/redcloth.rb', line 8

def prepare
  @engine = RedCloth.new(data)
  options.each {|k, v| @engine.send("#{k}=", v) if @engine.respond_to? "#{k}="}
  @output = nil
end