Class: Tilt::Pipeline
Overview
Superclass used for pipeline templates. Should not be used directly.
Instance Attribute Summary
Attributes inherited from Template
#compiled_path, #data, #file, #line, #options
Instance Method Summary collapse
Methods inherited from Template
#basename, #compiled_method, default_mime_type, default_mime_type=, #eval_file, #fixed_locals?, #initialize, #metadata, metadata, #name, #render
Constructor Details
This class inherits a constructor from Tilt::Template
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
20 21 22 |
# File 'lib/tilt/pipeline.rb', line 20 def evaluate(scope, locals, &block) @pipeline.call(scope, locals, &block) end |
#prepare ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/tilt/pipeline.rb', line 8 def prepare @pipeline = self.class::TEMPLATES.inject(proc{|*| data}) do |data, (klass, ext, )| proc do |s,l,&sb| = if ext_opts = [ext] = .merge(ext_opts) end klass.new(file, line, , &proc{|*| data.call(s, l, &sb)}).render(s, l, &sb) end end end |