Class: Kadim::MemoryResolver
- Inherits:
-
ActionView::Resolver
- Object
- ActionView::Resolver
- Kadim::MemoryResolver
- Includes:
- Singleton
- Defined in:
- lib/kadim/template/memory_resolver.rb
Defined Under Namespace
Classes: TemplateStore
Instance Method Summary collapse
- #add(body, path) ⇒ Object
- #clear ⇒ Object
-
#initialize ⇒ MemoryResolver
constructor
A new instance of MemoryResolver.
Constructor Details
#initialize ⇒ MemoryResolver
Returns a new instance of MemoryResolver.
39 40 41 42 |
# File 'lib/kadim/template/memory_resolver.rb', line 39 def initialize @cache = Cache.new @store = TemplateStore.new end |
Instance Method Details
#add(body, path) ⇒ Object
44 45 46 47 |
# File 'lib/kadim/template/memory_resolver.rb', line 44 def add(body, path) partial = path.split("/").last.start_with?("_") @store.add(body, path, partial) end |
#clear ⇒ Object
49 50 51 52 |
# File 'lib/kadim/template/memory_resolver.rb', line 49 def clear @cache.clear @store.clear end |