Class: Tilt::Pipeline

Inherits:
Template show all
Defined in:
lib/tilt/pipeline.rb

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, 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



14
15
16
# File 'lib/tilt/pipeline.rb', line 14

def evaluate(scope, locals, &block)
  @pipeline.call(scope, locals, &block)
end

#prepareObject



6
7
8
9
10
11
12
# File 'lib/tilt/pipeline.rb', line 6

def prepare
  @pipeline = self.class::TEMPLATES.inject(proc{|*| data}) do |data, (klass, options)|
    proc do |s,l,&sb|
      klass.new(file, line, options, &proc{|*| data.call(s, l, &sb)}).render(s, l, &sb)
    end
  end
end