Class: Tilt::ERBTemplate

### Home Classes Methods

### In Files

- lib/tilt/erb.rb

### Parent

Template

### Methods

- ::default_output_variable
- ::default_output_variable=
- ::engine_initialized?
- #initialize_engine
- #precompiled
- #precompiled_postamble
- #precompiled_preamble
- #precompiled_template
- #prepare

### Class/Module Index

Quicksearch

- Tilt
- Tilt::AsciidoctorTemplate
- Tilt::BlueClothTemplate
- Tilt::BuilderTemplate
- Tilt::CSVTemplate
- Tilt::Cache
- Tilt::CoffeeScriptTemplate
- Tilt::CompileSite
- Tilt::CreoleTemplate
- Tilt::ERBTemplate
- Tilt::ErubisTemplate
- Tilt::EtanniTemplate
- Tilt::HamlTemplate
- Tilt::KramdownTemplate
- Tilt::LessTemplate
- Tilt::LiquidTemplate
- Tilt::MarkabyTemplate
- Tilt::MarukuTemplate
- Tilt::NokogiriTemplate
- Tilt::PlainTemplate
- Tilt::RDiscountTemplate
- Tilt::RDocTemplate
- Tilt::RadiusTemplate
- Tilt::RedClothTemplate
- Tilt::RedcarpetTemplate
- Tilt::RedcarpetTemplate::Redcarpet1
- Tilt::RedcarpetTemplate::Redcarpet2
- Tilt::SassTemplate
- Tilt::ScssTemplate
- Tilt::StringTemplate
- Tilt::Template
- Tilt::WikiClothTemplate
- Tilt::YajlTemplate

No matching classes.

# Tilt::ERBTemplate

ERB template implementation. See: www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html

### Public Class Methods

default_output_variable() click to toggle source

    # File lib/tilt/erb.rb, line 9
    def self.default_output_variable
      @@default_output_variable
    end

default_output_variable=(name) click to toggle source

    # File lib/tilt/erb.rb, line 13
    def self.default_output_variable=(name)
      @@default_output_variable = name
    end

engine_initialized?() click to toggle source

    # File lib/tilt/erb.rb, line 17
    def self.engine_initialized?
      defined? ::ERB
    end

### Public Instance Methods

initialize_engine() click to toggle source

    # File lib/tilt/erb.rb, line 21
    def initialize_engine
      require_template_library 'erb'
    end

precompiled(locals) click to toggle source

    # File lib/tilt/erb.rb, line 56
    def precompiled(locals)
      source, offset = super
      [source, offset + 1]
    end

precompiled_postamble(locals) click to toggle source

    # File lib/tilt/erb.rb, line 44
    def precompiled_postamble(locals)
                #{super}        ensure          #{@outvar} = __original_outvar        end
    end

precompiled_preamble(locals) click to toggle source

    # File lib/tilt/erb.rb, line 36
    def precompiled_preamble(locals)
              begin          __original_outvar = #{@outvar} if defined?(#{@outvar})          #{super}
    end

precompiled_template(locals) click to toggle source

    # File lib/tilt/erb.rb, line 31
    def precompiled_template(locals)
      source = @engine.src
      source
    end

prepare() click to toggle source

    # File lib/tilt/erb.rb, line 25
    def prepare
      @outvar = options[:outvar] || self.class.default_output_variable
      options[:trim] = '<>' if !(options[:trim] == false) && (options[:trim].nil? || options[:trim] == true)
      @engine = ::ERB.new(data, options[:safe], options[:trim], @outvar)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.