Module: Card::View::Cache::ClassMethods

Included in:
Card::View
Defined in:
lib/card/view/cache.rb

Overview

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cache-related Card::View class methods

Instance Method Summary collapse

Instance Method Details

#cacheObject



296
297
298
# File 'lib/card/view/cache.rb', line 296

def cache
  Card::Cache[Card::View]
end

#caching(setting, &block) ⇒ Object



304
305
306
307
308
# File 'lib/card/view/cache.rb', line 304

def caching setting, &block
  return @caching unless block_given?

  caching_mode setting, &block
end

#caching?Boolean

Returns:

  • (Boolean)


300
301
302
# File 'lib/card/view/cache.rb', line 300

def caching?
  !@caching.nil?
end