Module: Cachable Private

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Constant Summary collapse

Cache =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

Sorbet type members are mutable by design and cannot be frozen.

type_member { { upper: T::Hash[T.anything, T.anything] } }

Instance Method Summary collapse

Instance Method Details

#cacheCache

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



10
11
12
# File 'cachable.rb', line 10

def cache
  @cache ||= T.let(T.cast({}, Cache), T.nilable(Cache))
end

#clear_cachevoid

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.



15
16
17
# File 'cachable.rb', line 15

def clear_cache
  cache.clear
end