Sha256: 2022385077e19f69314c252623e049859987a7230cf516cf3de0f28e00092c43

Contents?: true

Size: 461 Bytes

Versions: 18

Compression:

Stored size: 461 Bytes

Contents

# frozen_string_literal: true

module Grape
  module ServeStream
    # Response should respond to to_path method
    # for using Rack::SendFile middleware
    class SendfileResponse < Rack::Response
      def respond_to?(method_name, include_all = false)
        if method_name == :to_path
          @body.respond_to?(:to_path, include_all)
        else
          super
        end
      end

      def to_path
        @body.to_path
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
grape-2.2.0 lib/grape/serve_stream/sendfile_response.rb
grape-2.1.3 lib/grape/serve_stream/sendfile_response.rb
grape-2.1.2 lib/grape/serve_stream/sendfile_response.rb
grape-2.1.1 lib/grape/serve_stream/sendfile_response.rb
grape-2.1.0 lib/grape/serve_stream/sendfile_response.rb
grape-2.0.0 lib/grape/serve_stream/sendfile_response.rb
grape-1.8.0 lib/grape/serve_stream/sendfile_response.rb
grape-1.7.1 lib/grape/serve_stream/sendfile_response.rb
grape-1.7.0 lib/grape/serve_stream/sendfile_response.rb
grape-1.6.2 lib/grape/serve_stream/sendfile_response.rb
grape-1.6.1 lib/grape/serve_stream/sendfile_response.rb
grape-1.6.0 lib/grape/serve_stream/sendfile_response.rb
grape-1.5.3 lib/grape/serve_stream/sendfile_response.rb
grape-1.5.2 lib/grape/serve_stream/sendfile_response.rb
grape-1.5.1 lib/grape/serve_stream/sendfile_response.rb
grape-1.5.0 lib/grape/serve_stream/sendfile_response.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.4.0/lib/grape/serve_stream/sendfile_response.rb
grape-1.4.0 lib/grape/serve_stream/sendfile_response.rb