Class: Wunderbar::Template::Base
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- Wunderbar::Template::Base
- Defined in:
- lib/wunderbar/sinatra.rb
Direct Known Subclasses
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
45 46 47 |
# File 'lib/wunderbar/sinatra.rb', line 45 def self.engine_initialized? defined? ::Wunderbar end |
.evaluate(template, scope, *args, &block) ⇒ Object
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/wunderbar/sinatra.rb', line 68 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
49 50 51 |
# File 'lib/wunderbar/sinatra.rb', line 49 def initialize_engine require_template_library 'wunderbar' end |
#precompiled_postamble(locals) ⇒ Object
64 65 66 |
# File 'lib/wunderbar/sinatra.rb', line 64 def precompiled_postamble(locals) raise NotImplementedError.new("dynamic only") end |
#precompiled_preamble(locals) ⇒ Object
60 61 62 |
# File 'lib/wunderbar/sinatra.rb', line 60 def precompiled_preamble(locals) raise NotImplementedError.new("dynamic only") end |
#precompiled_template(locals) ⇒ Object
56 57 58 |
# File 'lib/wunderbar/sinatra.rb', line 56 def precompiled_template(locals) raise NotImplementedError.new("dynamic only") end |
#prepare ⇒ Object
53 54 |
# File 'lib/wunderbar/sinatra.rb', line 53 def prepare end |