Module: LaserLemon::CacheFlow::ClassMethods

Defined in:
lib/cache_flow.rb

Instance Method Summary collapse

Instance Method Details

#cache_flow(value = true) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/cache_flow.rb', line 17

def cache_flow(value = true)
  if block_given?
    old_value = cache_serialization
    begin
      self.cache_serialization = value
      yield
    ensure
      self.cache_serialization = old_value
    end
  else
    self.cache_serialization = value
  end
end