Class: Grape::ServeStream::StreamResponse
- Inherits:
-
Object
- Object
- Grape::ServeStream::StreamResponse
- 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
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Equality provided mostly for tests.
-
#initialize(stream) ⇒ StreamResponse
constructor
A new instance of StreamResponse.
Constructor Details
#initialize(stream) ⇒ StreamResponse
Returns a new instance of StreamResponse.
11 12 13 |
# File 'lib/grape/serve_stream/stream_response.rb', line 11 def initialize(stream) @stream = stream end |
Instance Attribute Details
#stream ⇒ Object (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.
18 19 20 |
# File 'lib/grape/serve_stream/stream_response.rb', line 18 def ==(other) stream == other.stream end |