Class: Curlybars::TemplateHandler
- Inherits:
-
Object
- Object
- Curlybars::TemplateHandler
- Defined in:
- lib/curlybars/template_handler.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.cache_if_key_is_not_nil(context, presenter) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/curlybars/template_handler.rb', line 30 def cache_if_key_is_not_nil(context, presenter) key = presenter.cache_key if key.present? presenter_key = if presenter.class.respond_to?(:cache_key) presenter.class.cache_key end = presenter. || {} [:expires_in] ||= presenter.cache_duration # Curlybars doesn't allow Rails to handle the template digest. # So, we disable it. [:skip_digest] = true context.cache([key, presenter_key].compact, ) do yield end else yield end end |
Instance Method Details
#call(template, source) ⇒ Object
17 18 19 20 21 |
# File 'lib/curlybars/template_handler.rb', line 17 def call(template) instrument(template) do compile_for_actionview5(template) end end |