Module: Restforce::Concerns::Caching

Included in:
AbstractClient
Defined in:
lib/restforce/concerns/caching.rb

Instance Method Summary collapse

Instance Method Details

#with_cachingObject



18
19
20
21
22
23
# File 'lib/restforce/concerns/caching.rb', line 18

def with_caching
  options[:use_cache] = true
  yield
ensure
  options[:use_cache] = false
end

#without_cachingObject

Public: Runs the block with caching disabled.

block - A query/describe/etc.

Returns the result of the block



11
12
13
14
15
16
# File 'lib/restforce/concerns/caching.rb', line 11

def without_caching
  options[:use_cache] = false
  yield
ensure
  options.delete(:use_cache)
end