Class: Grape::ServeStream::StreamResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/grape/serve_stream/stream_response.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ StreamResponse

Returns a new instance of StreamResponse.

Parameters:

  • stream (Object)


11
12
13
# File 'lib/grape/serve_stream/stream_response.rb', line 11

def initialize(stream)
  @stream = stream
end

Instance Attribute Details

#streamObject (readonly)

Returns the value of attribute stream.



8
9
10
# File 'lib/grape/serve_stream/stream_response.rb', line 8

def stream
  @stream
end

Instance Method Details

#==(other) ⇒ Boolean

Equality provided mostly for tests.

Returns:

  • (Boolean)


18
19
20
# File 'lib/grape/serve_stream/stream_response.rb', line 18

def ==(other)
  stream == other.stream
end