Module: Cachable Private
- Included in:
- AbstractTab, Dependency, DependencyCollector, Formula, Formulary, Homebrew::API, Homebrew::API::Cask, Homebrew::API::Formula, Keg, Readall, Requirement, Tap, Utils::Analytics
- Defined in:
- extend/cachable.rb
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.
Instance Method Summary collapse
- #cache ⇒ Hash{T.untyped => T.untyped} private
- #clear_cache ⇒ void private
Instance Method Details
#cache ⇒ Hash{T.untyped => T.untyped}
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.
6 7 8 |
# File 'extend/cachable.rb', line 6 def cache @cache ||= T.let({}, T.nilable(T::Hash[T.untyped, T.untyped])) end |
#clear_cache ⇒ void
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.
We overwrite here instead of using Hash#clear
to handle frozen hashes.
This method returns an undefined value.
12 13 14 |
# File 'extend/cachable.rb', line 12 def clear_cache overwrite_cache!({}) end |