Sha256: 341a1b8b8c7bc99dd149f7ea9bd7c7686ec2ff2418746ed7c0c9c57428a4de43

Contents?: true

Size: 608 Bytes

Versions: 6

Compression:

Stored size: 608 Bytes

Contents

require 'tomograph'
require 'esplanade/request'
require 'esplanade/response'

module Esplanade
  class Middleware
    def initialize(
      app,
      prefix: Esplanade.configuration.prefix,
      apib_path: Esplanade.configuration.apib_path,
      drafter_yaml_path: Esplanade.configuration.drafter_yaml_path
    )
      @app = app
      @documentation = Tomograph::Tomogram.new(
        prefix: prefix,
        apib_path: apib_path,
        drafter_yaml_path: drafter_yaml_path
      )
    end

    def call(env)
      status, headers, body = @app.call(env)
      [status, headers, body]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
esplanade-1.6.0 lib/esplanade/middleware.rb
esplanade-1.5.0 lib/esplanade/middleware.rb
esplanade-1.4.0 lib/esplanade/middleware.rb
esplanade-1.3.0 lib/esplanade/middleware.rb
esplanade-1.2.1 lib/esplanade/middleware.rb
esplanade-1.2.0 lib/esplanade/middleware.rb