Class: Tilt::RedClothTemplate
- Inherits:
-
Template
show all
- Defined in:
- lib/vendor/tilt-1.4.1/lib/tilt/textile.rb
Overview
Instance Attribute Summary
Attributes inherited from Template
#data, #file, #line, #options
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Template
#basename, #default_encoding, #eval_file, #initialize, #name, #read_template_file, #render
Constructor Details
This class inherits a constructor from Tilt::Template
Class Method Details
.engine_initialized? ⇒ Boolean
7
8
9
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/textile.rb', line 7
def self.engine_initialized?
defined? ::RedCloth
end
|
Instance Method Details
#allows_script? ⇒ Boolean
25
26
27
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/textile.rb', line 25
def allows_script?
false
end
|
#evaluate(scope, locals, &block) ⇒ Object
21
22
23
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/textile.rb', line 21
def evaluate(scope, locals, &block)
@output ||= @engine.to_html
end
|
#initialize_engine ⇒ Object
11
12
13
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/textile.rb', line 11
def initialize_engine
require_template_library 'redcloth'
end
|
15
16
17
18
19
|
# File 'lib/vendor/tilt-1.4.1/lib/tilt/textile.rb', line 15
def prepare
@engine = RedCloth.new(data)
options.each {|k, v| @engine.send("#{k}=", v) if @engine.respond_to? "#{k}="}
@output = nil
end
|