Class: Protocol::Rack::Body::Streaming::Output
- Inherits:
-
Object
- Object
- Protocol::Rack::Body::Streaming::Output
- Defined in:
- lib/protocol/rack/body/streaming.rb
Instance Method Summary collapse
- #close ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(block) ⇒ Output
constructor
A new instance of Output.
- #write(chunk) ⇒ Object
Constructor Details
#initialize(block) ⇒ Output
Returns a new instance of Output.
36 37 38 |
# File 'lib/protocol/rack/body/streaming.rb', line 36 def initialize(block) @block = block end |
Instance Method Details
#close ⇒ Object
44 45 46 |
# File 'lib/protocol/rack/body/streaming.rb', line 44 def close @block = nil end |
#empty? ⇒ Boolean
48 49 50 |
# File 'lib/protocol/rack/body/streaming.rb', line 48 def empty? true end |
#write(chunk) ⇒ Object
40 41 42 |
# File 'lib/protocol/rack/body/streaming.rb', line 40 def write(chunk) @block.call(chunk) end |