Class: AppManager::Actions::ApiCacheHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/app_manager/api_cache_handler.rb

Instance Method Summary collapse

Constructor Details

#initializeApiCacheHandler

Returns a new instance of ApiCacheHandler.



4
5
6
# File 'lib/app_manager/api_cache_handler.rb', line 4

def initialize
  
end

Instance Method Details

#around(controller) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/app_manager/api_cache_handler.rb', line 9

def around(controller)
  init(controller)
  if should_response_cache?
    log_info
    render_cached_response
  else
    yield
    @response_cache.write_cache(controller.response) if @request.get?
  end
end