Class: Rack::Lint::Wrapper::StreamWrapper
- Inherits:
-
Object
- Object
- Rack::Lint::Wrapper::StreamWrapper
- Extended by:
- Forwardable
- Defined in:
- lib/rack/lint.rb
Constant Summary collapse
- REQUIRED_METHODS =
The semantics of these
IO
methods must be a best effort match to those of a normal RubyIO
orSocket
object, using standard arguments and raising standard exceptions. Servers may simply pass on realIO
objects to the Streaming Body. In some cases (e.g. when usingtransfer-encoding
or HTTP/2+), the server may need to provide a wrapper that implements the required methods, in order to provide the correct semantics. [ :read, :write, :<<, :flush, :close, :close_read, :close_write, :closed? ]
Instance Method Summary collapse
-
#initialize(stream) ⇒ StreamWrapper
constructor
A new instance of StreamWrapper.
Constructor Details
#initialize(stream) ⇒ StreamWrapper
Returns a new instance of StreamWrapper.
948 949 950 951 952 953 954 |
# File 'lib/rack/lint.rb', line 948 def initialize(stream) @stream = stream REQUIRED_METHODS.each do |method_name| raise LintError, "Stream must respond to #{method_name}" unless stream.respond_to?(method_name) end end |