Class: Rack::App::FrontEnd::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/app/front_end/template.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.cacheObject



8
9
10
# File 'lib/rack/app/front_end/template.rb', line 8

def self.cache
  @cache ||= Tilt::Cache.new
end

.template?(file_path) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/rack/app/front_end/template.rb', line 12

def self.template?(file_path)
  not Tilt.templates_for(file_path).empty?
end

Instance Method Details

#render(scope, variables = {}, &block) ⇒ Object



16
17
18
# File 'lib/rack/app/front_end/template.rb', line 16

def render(scope, variables={}, &block)
  layout.render(scope, variables) { template.render(scope, variables, &block) }
end