Class: Pundit::CacheStore::NullStore Private

Inherits:
Object
  • Object
show all
Defined in:
lib/pundit/cache_store/null_store.rb

Overview

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

A cache store that does not cache anything.

Use ‘NullStore.instance` to get the singleton instance, it is thread-safe.

See Also:

Since:

  • v2.3.2

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.instanceNullStore (readonly)

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.

Returns the singleton instance.

Returns:

Since:

  • v2.3.2



18
19
20
# File 'lib/pundit/cache_store/null_store.rb', line 18

def instance
  @instance
end

Instance Method Details

#fetch { ... } ⇒ any

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.

Always yields, does not cache anything.

Yields:

Returns:

  • (any)

    whatever the block returns.

Since:

  • v2.3.2



25
26
27
# File 'lib/pundit/cache_store/null_store.rb', line 25

def fetch(*, **)
  yield
end