Module: FastCodeOwners::FilePathTeamCache

Extended by:
T::Helpers, T::Sig
Defined in:
lib/fast_code_owners/file_path_team_cache.rb

Class Method Summary collapse

Class Method Details

.bust_cache!Object



28
29
30
# File 'lib/fast_code_owners/file_path_team_cache.rb', line 28

def bust_cache!
  @cache = nil
end

.cacheObject



33
34
35
36
37
# File 'lib/fast_code_owners/file_path_team_cache.rb', line 33

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

.cached?(file_path) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/fast_code_owners/file_path_team_cache.rb', line 23

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

.get(file_path) ⇒ Object



13
14
15
# File 'lib/fast_code_owners/file_path_team_cache.rb', line 13

def get(file_path)
  cache[file_path]
end

.set(file_path, team) ⇒ Object



18
19
20
# File 'lib/fast_code_owners/file_path_team_cache.rb', line 18

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