Class: MustacheView
- Inherits:
-
Mustache
- Object
- Mustache
- MustacheView
- Defined in:
- lib/shared_mustache/mustache_view.rb
Instance Method Summary collapse
-
#initialize ⇒ MustacheView
constructor
A new instance of MustacheView.
- #partial(name) ⇒ Object
Constructor Details
#initialize ⇒ MustacheView
Returns a new instance of MustacheView.
5 6 7 8 |
# File 'lib/shared_mustache/mustache_view.rb', line 5 def initialize super @partial_cache = {} end |
Instance Method Details
#partial(name) ⇒ Object
10 11 12 |
# File 'lib/shared_mustache/mustache_view.rb', line 10 def partial(name) @partial_cache[name] ||= File.read("#{template_path}/#{name}.#{template_extension}") end |