module Restforce::Concerns::Caching

Public Instance Methods

with_caching() { || ... } click to toggle source
# File lib/restforce/concerns/caching.rb, line 18
def with_caching
  options[:use_cache] = true
  yield
ensure
  options[:use_cache] = false
end
without_caching() { || ... } click to toggle source

Public: Runs the block with caching disabled.

block - A query/describe/etc.

Returns the result of the block

# File lib/restforce/concerns/caching.rb, line 11
def without_caching
  options[:use_cache] = false
  yield
ensure
  options.delete(:use_cache)
end

Private Instance Methods

cache() click to toggle source

Internal: Cache to use for the caching middleware

# File lib/restforce/concerns/caching.rb, line 28
def cache
  options[:cache]
end