Class: Temple::Templates::Tilt

Inherits:
Tilt::Template
  • Object
show all
Extended by:
Mixins::Template
Defined in:
lib/temple/templates/tilt.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from Mixins::Template

build_engine, chain, engine

Methods included from Mixins::DefaultOptions

#default_options, #set_default_options

Class Method Details

+ (Object) register_as(name)



25
26
27
# File 'lib/temple/templates/tilt.rb', line 25

def self.register_as(name)
  ::Tilt.register name.to_s, self
end

Instance Method Details

- (String) precompiled_template(locals = {})

A string containing the (Ruby) source code for the template.

Parameters:

  • locals (Hash) (defaults to: {})

    Local variables

Returns:

  • (String)

    Compiled template ruby code



21
22
23
# File 'lib/temple/templates/tilt.rb', line 21

def precompiled_template(locals = {})
  @src
end

- (void) prepare

This method returns an undefined value.

Prepare Temple template

Called immediately after template data is loaded.



13
14
15
# File 'lib/temple/templates/tilt.rb', line 13

def prepare
  @src = self.class.build_engine({ :file => eval_file }, options).call(data)
end