Module: Restforce::Concerns::Caching
- Included in:
- AbstractClient
- Defined in:
- lib/restforce/concerns/caching.rb
Instance Method Summary collapse
- #with_caching ⇒ Object
-
#without_caching ⇒ Object
Public: Runs the block with caching disabled.
Instance Method Details
#with_caching ⇒ Object
18 19 20 21 22 23 |
# File 'lib/restforce/concerns/caching.rb', line 18 def with_caching [:use_cache] = true yield ensure [:use_cache] = false end |
#without_caching ⇒ Object
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 [:use_cache] = false yield ensure .delete(:use_cache) end |