Class: PagesCore::CacheSweeper

Inherits:
Object
  • Object
show all
Defined in:
lib/pages_core/cache_sweeper.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.enabledObject

Returns the value of attribute enabled.



6
7
8
# File 'lib/pages_core/cache_sweeper.rb', line 6

def enabled
  @enabled
end

Class Method Details

.disableObject



8
9
10
11
12
13
# File 'lib/pages_core/cache_sweeper.rb', line 8

def disable(&)
  old_value = enabled
  self.enabled = false
  yield if block_given?
  self.enabled = old_value
end

.onceObject



15
16
17
18
# File 'lib/pages_core/cache_sweeper.rb', line 15

def once(&)
  disable(&)
  PagesCore::StaticCache.handler.sweep!
end