Class: Tilt::BabelTemplate
Instance Attribute Summary
Attributes inherited from Template
#compiled_path, #data, #file, #line, #options
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
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
12 13 14 |
# File 'lib/tilt/babel.rb', line 12 def evaluate(scope, locals, &block) @output ||= Babel::Transpiler.transform(data)["code"] end |
#prepare ⇒ Object
8 9 10 |
# File 'lib/tilt/babel.rb', line 8 def prepare [:filename] ||= file end |