Class: Typescript::Rails::TypeScriptTemplate
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- Typescript::Rails::TypeScriptTemplate
- Defined in:
- lib/typescript/rails/template_handler.rb
Constant Summary collapse
- @@default_bare =
false
Class Method Summary collapse
- .default_bare ⇒ Object
- .default_bare=(value) ⇒ Object
-
.default_no_wrap ⇒ Object
DEPRECATED.
-
.default_no_wrap=(value) ⇒ Object
DEPRECATED.
- .engine_initialized? ⇒ Boolean
Instance Method Summary collapse
- #allows_script? ⇒ Boolean
- #evaluate(scope, locals, &block) ⇒ Object
- #initialize_engine ⇒ Object
- #prepare ⇒ Object
Class Method Details
.default_bare ⇒ Object
11 12 13 |
# File 'lib/typescript/rails/template_handler.rb', line 11 def self. @@default_bare end |
.default_bare=(value) ⇒ Object
15 16 17 |
# File 'lib/typescript/rails/template_handler.rb', line 15 def self.(value) @@default_bare = value end |
.default_no_wrap ⇒ Object
DEPRECATED
20 21 22 |
# File 'lib/typescript/rails/template_handler.rb', line 20 def self.default_no_wrap @@default_bare end |
.default_no_wrap=(value) ⇒ Object
DEPRECATED
25 26 27 |
# File 'lib/typescript/rails/template_handler.rb', line 25 def self.default_no_wrap=(value) @@default_bare = value end |
.engine_initialized? ⇒ Boolean
29 30 31 |
# File 'lib/typescript/rails/template_handler.rb', line 29 def self.engine_initialized? defined? ::TypeScript end |
Instance Method Details
#allows_script? ⇒ Boolean
47 48 49 |
# File 'lib/typescript/rails/template_handler.rb', line 47 def allows_script? false end |
#evaluate(scope, locals, &block) ⇒ Object
43 44 45 |
# File 'lib/typescript/rails/template_handler.rb', line 43 def evaluate(scope, locals, &block) @output ||= TypeScript.compile(data, ) end |
#initialize_engine ⇒ Object
33 34 35 |
# File 'lib/typescript/rails/template_handler.rb', line 33 def initialize_engine require_template_library 'coffee_script' end |
#prepare ⇒ Object
37 38 39 40 41 |
# File 'lib/typescript/rails/template_handler.rb', line 37 def prepare if !.key?(:bare) and !.key?(:no_wrap) [:bare] = self.class. end end |