Sha256: daaaecd0e3892dd1170adc176c26665b5ae8402098618221c47c7e19c6aac363

Contents?: true

Size: 521 Bytes

Versions: 18

Compression:

Stored size: 521 Bytes

Contents

# frozen_string_literal: true

module Grape
  module ServeStream
    # A simple class used to identify responses which represent streams (or files) and do not
    # need to be formatted or pre-read by Rack::Response
    class StreamResponse
      attr_reader :stream

      # @param stream [Object]
      def initialize(stream)
        @stream = stream
      end

      # Equality provided mostly for tests.
      #
      # @return [Boolean]
      def ==(other)
        stream == other.stream
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

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