Module: Erector::Caching::ClassMethods
- Defined in:
- lib/erector/caching.rb
Instance Method Summary collapse
- #cachable? ⇒ Boolean
- #cache ⇒ Object
- #cache_version ⇒ Object
- #cacheable(value = true) ⇒ Object (also: #cachable)
Instance Method Details
#cachable? ⇒ Boolean
18 19 20 21 22 23 24 |
# File 'lib/erector/caching.rb', line 18 def cachable? if @cachable.nil? superclass.respond_to?(:cachable?) && superclass.cachable? else @cachable end end |
#cache ⇒ Object
30 31 32 |
# File 'lib/erector/caching.rb', line 30 def cache Erector::Cache.instance end |
#cache_version ⇒ Object
26 27 28 |
# File 'lib/erector/caching.rb', line 26 def cache_version @cache_version || nil end |
#cacheable(value = true) ⇒ Object Also known as: cachable
8 9 10 11 12 13 14 |
# File 'lib/erector/caching.rb', line 8 def cacheable(value = true) @cachable = value if value && value != true @cache_version = value end end |