Class: Sinicum::Jcr::Cache::GlobalCache
- Inherits:
-
Object
- Object
- Sinicum::Jcr::Cache::GlobalCache
- Includes:
- ApiClient
- Defined in:
- lib/sinicum/jcr/cache/global_cache.rb
Overview
Public: Fetches the global cache key from the JCR server.
Constant Summary collapse
- API_PATH =
"/_cache/global"
- JSON_CACHE_KEY =
"cacheKey"
Instance Method Summary collapse
Methods included from ApiClient
Methods included from Logger
Instance Method Details
#current_key ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sinicum/jcr/cache/global_cache.rb', line 10 def current_key result = nil response = api_get(API_PATH) if response.ok? begin json = MultiJson.load(response.body) result = json[JSON_CACHE_KEY] rescue => e Rails.logger.error("Cannot load global cache key: " + e.) end end result end |