Module: Authz::Cache Private

Defined in:
lib/authz/cache.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

This module is a wrapper of Rails.cache and serves as a central point for configuring how Authz’s internal Cache works depending on the gem’s configuration

Class Method Summary collapse

Class Method Details

.fetch(name, options = nil, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
11
12
13
14
# File 'lib/authz/cache.rb', line 8

def self.fetch(name, options = nil, &block)
  if Authz.cross_request_caching
    Rails.cache.fetch(name, options, &block)
  else
    block.call
  end
end