Class: Wunderbar::Template::Base
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- Wunderbar::Template::Base
- Defined in:
- lib/wunderbar/sinatra.rb
Class Method Summary collapse
Instance Method Summary collapse
- #initialize_engine ⇒ Object
- #precompiled_postamble(locals) ⇒ Object
- #precompiled_preamble(locals) ⇒ Object
- #precompiled_template(locals) ⇒ Object
- #prepare ⇒ Object
Class Method Details
.engine_initialized? ⇒ Boolean
9 10 11 |
# File 'lib/wunderbar/sinatra.rb', line 9 def self.engine_initialized? defined? ::Wunderbar end |
.evaluate(template, scope, *args, &block) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/wunderbar/sinatra.rb', line 32 def self.evaluate(template, scope, *args, &block) scope.content_type default_mime_type if block output = new(&Proc.new {}).evaluate(scope, {}, &block) else output = scope.send :render, template, *args end scope.etag Digest::MD5.hexdigest(output) output end |
Instance Method Details
#initialize_engine ⇒ Object
13 14 15 |
# File 'lib/wunderbar/sinatra.rb', line 13 def initialize_engine require_template_library 'wunderbar' end |
#precompiled_postamble(locals) ⇒ Object
28 29 30 |
# File 'lib/wunderbar/sinatra.rb', line 28 def precompiled_postamble(locals) raise NotImplementedError.new("dynamic only") end |
#precompiled_preamble(locals) ⇒ Object
24 25 26 |
# File 'lib/wunderbar/sinatra.rb', line 24 def precompiled_preamble(locals) raise NotImplementedError.new("dynamic only") end |
#precompiled_template(locals) ⇒ Object
20 21 22 |
# File 'lib/wunderbar/sinatra.rb', line 20 def precompiled_template(locals) raise NotImplementedError.new("dynamic only") end |
#prepare ⇒ Object
17 18 |
# File 'lib/wunderbar/sinatra.rb', line 17 def prepare end |