Class: ProtectedBranch::CacheKey

Inherits:
Object
  • Object
show all
Includes:
Gitlab::Utils::StrongMemoize
Defined in:
app/models/protected_branch/cache_key.rb

Overview

rubocop:disable Style/ClassAndModuleChildren – Same problem as in push_access_level.rb

Constant Summary collapse

CACHE_ROOT_KEY =
'cache:gitlab:protected_branch'

Instance Method Summary collapse

Constructor Details

#initialize(entity) ⇒ CacheKey

Returns a new instance of CacheKey.



8
9
10
# File 'app/models/protected_branch/cache_key.rb', line 8

def initialize(entity)
  @entity = entity
end

Instance Method Details

#to_sObject



12
13
14
# File 'app/models/protected_branch/cache_key.rb', line 12

def to_s
  [CACHE_ROOT_KEY, entity_scope, entity.id].join(':')
end