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



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

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

#prepareObject



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

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