Sha256: 4fd37e6010e4044b50e6c11088591f50a3e2aa972da21fa2d28568d1b7a74006

Contents?: true

Size: 663 Bytes

Versions: 1

Compression:

Stored size: 663 Bytes

Contents

module Apress
  module Documentation
    class SwaggerController < ::ActionController::Base
      include ::Apress::Documentation::PreloadDocs

      def show
        service = Apress::Documentation::SwaggerJsonBuilder.new(params[:slug])
        data =
          if Rails.application.config.action_controller.perform_caching
            key = ActiveSupport::Cache.expand_cache_key(["swagger_schema", params[:slug]])
            Rails.cache.fetch(key) { service.call }
          else
            service.call
          end

        render json: data
      end

      ActiveSupport.run_load_hooks(:'apress/documentation/swagger_controller', self)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
apress-documentation-0.4.0 app/controllers/apress/documentation/swagger_controller.rb