Class: Tilt::CoffeeScriptTemplate
- Inherits:
-
StaticTemplate
- Object
- Template
- StaticTemplate
- Tilt::CoffeeScriptTemplate
- Defined in:
- lib/tilt/coffee.rb
Overview
CoffeeScript template implementation. See: coffeescript.org/
CoffeeScript templates do not support object scopes, locals, or yield.
Direct Known Subclasses
Class Attribute Summary collapse
-
.default_bare ⇒ Object
Returns the value of attribute default_bare.
Attributes inherited from Template
#compiled_path, #data, #file, #line, #options
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from StaticTemplate
#allows_script?, #compiled_method, #render, subclass
Methods inherited from Template
#basename, #compiled_method, default_mime_type, default_mime_type=, #eval_file, #initialize, metadata, #metadata, #name, #render
Constructor Details
This class inherits a constructor from Tilt::Template
Class Attribute Details
.default_bare ⇒ Object
Returns the value of attribute default_bare.
15 16 17 |
# File 'lib/tilt/coffee.rb', line 15 def @default_bare end |
Class Method Details
.literate? ⇒ Boolean
18 19 20 |
# File 'lib/tilt/coffee.rb', line 18 def self.literate? false end |
Instance Method Details
#prepare ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/tilt/coffee.rb', line 22 def prepare if !@options.key?(:bare) and !@options.key?(:no_wrap) @options[:bare] = self.class. end @options[:literate] ||= self.class.literate? @output = CoffeeScript.compile(@data, @options) end |