Class: 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
Constant Summary collapse
- @@default_bare =
false
Instance Attribute Summary
Attributes inherited from Template
#compiled_path, #data, #file, #line, #options
Class Method Summary collapse
- .default_bare ⇒ Object
- .default_bare=(value) ⇒ Object
-
.default_no_wrap ⇒ Object
DEPRECATED.
-
.default_no_wrap=(value) ⇒ Object
DEPRECATED.
- .literate? ⇒ Boolean
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
Class Method Details
.default_bare ⇒ Object
14 15 16 |
# File 'lib/tilt/coffee.rb', line 14 def self. @@default_bare end |
.default_bare=(value) ⇒ Object
18 19 20 |
# File 'lib/tilt/coffee.rb', line 18 def self.(value) @@default_bare = value end |
.default_no_wrap ⇒ Object
DEPRECATED
23 24 25 |
# File 'lib/tilt/coffee.rb', line 23 def self.default_no_wrap @@default_bare end |
.default_no_wrap=(value) ⇒ Object
DEPRECATED
28 29 30 |
# File 'lib/tilt/coffee.rb', line 28 def self.default_no_wrap=(value) @@default_bare = value end |
.literate? ⇒ Boolean
32 33 34 |
# File 'lib/tilt/coffee.rb', line 32 def self.literate? false end |
Instance Method Details
#allows_script? ⇒ Boolean
47 48 49 |
# File 'lib/tilt/coffee.rb', line 47 def allows_script? false end |
#evaluate(scope, locals, &block) ⇒ Object
43 44 45 |
# File 'lib/tilt/coffee.rb', line 43 def evaluate(scope, locals, &block) @output ||= CoffeeScript.compile(data, ) end |
#prepare ⇒ Object
36 37 38 39 40 41 |
# File 'lib/tilt/coffee.rb', line 36 def prepare if !.key?(:bare) and !.key?(:no_wrap) [:bare] = self.class. end [:literate] ||= self.class.literate? end |