Module: CodeOwnership::Private::FilePathTeamCache

Extended by:
T::Sig
Defined in:
lib/code_ownership/private/file_path_team_cache.rb

Class Method Summary collapse

Class Method Details

.bust_cache!Object



25
26
27
# File 'lib/code_ownership/private/file_path_team_cache.rb', line 25

def self.bust_cache!
  @cache = nil
end

.cacheObject



30
31
32
33
34
# File 'lib/code_ownership/private/file_path_team_cache.rb', line 30

def self.cache
  @cache ||= T.let(@cache,
    T.nilable(T::Hash[String, T.nilable(CodeTeams::Team)]))
  @cache ||= {}
end

.cached?(file_path) ⇒ Boolean

Returns:



20
21
22
# File 'lib/code_ownership/private/file_path_team_cache.rb', line 20

def self.cached?(file_path)
  cache.key?(file_path)
end

.get(file_path) ⇒ Object



10
11
12
# File 'lib/code_ownership/private/file_path_team_cache.rb', line 10

def self.get(file_path)
  cache[file_path]
end

.set(file_path, team) ⇒ Object



15
16
17
# File 'lib/code_ownership/private/file_path_team_cache.rb', line 15

def self.set(file_path, team)
  cache[file_path] = team
end