Class: Apress::Documentation::SwaggerController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Apress::Documentation::SwaggerController
- Includes:
- PreloadDocs
- Defined in:
- app/controllers/apress/documentation/swagger_controller.rb
Instance Method Summary collapse
Methods included from PreloadDocs
Instance Method Details
#show ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/apress/documentation/swagger_controller.rb', line 6 def show service = Apress::Documentation::SwaggerJsonBuilder.new(params[:slug]) data = if Rails.application.config.action_controller.perform_caching key = ActiveSupport::Cache.(["swagger_schema", params[:slug]]) Rails.cache.fetch(key) { service.call } else service.call end render json: data end |