Class: TypeScript::Rails::Template
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- TypeScript::Rails::Template
- Defined in:
- lib/typescript/rails/template.rb
Class Method Summary collapse
Instance Method Summary collapse
- #allows_script? ⇒ Boolean
- #evaluate(context, locals, &block) ⇒ Object
- #initialize_engine ⇒ Object
- #prepare ⇒ Object
Class Method Details
.default_bare ⇒ Object
8 |
# File 'lib/typescript/rails/template.rb', line 8 class_attribute :default_bare |
.engine_initialized? ⇒ Boolean
10 11 12 |
# File 'lib/typescript/rails/template.rb', line 10 def self.engine_initialized? defined? ::TypeScript::Rails::Compiler end |
Instance Method Details
#allows_script? ⇒ Boolean
29 30 31 |
# File 'lib/typescript/rails/template.rb', line 29 def allows_script? false end |
#evaluate(context, locals, &block) ⇒ Object
24 25 26 |
# File 'lib/typescript/rails/template.rb', line 24 def evaluate(context, locals, &block) @output ||= ::TypeScript::Rails::Compiler.compile(file, data, context) end |
#initialize_engine ⇒ Object
14 15 16 |
# File 'lib/typescript/rails/template.rb', line 14 def initialize_engine require_template_library 'typescript/rails/compiler' end |
#prepare ⇒ Object
18 19 20 21 22 |
# File 'lib/typescript/rails/template.rb', line 18 def prepare if !.key?(:bare) and !.key?(:no_wrap) [:bare] = self.class. end end |