Class: Tus::Response
- Inherits:
-
Object
- Object
- Tus::Response
- Defined in:
- lib/tus/response.rb
Overview
Object that responds to #each, #length, and #close, suitable for returning as a Rack response body.
Direct Known Subclasses
Instance Method Summary collapse
- #close ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(chunks:, close: ->{}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(chunks:, close: ->{}) ⇒ Response
Returns a new instance of Response.
5 6 7 8 |
# File 'lib/tus/response.rb', line 5 def initialize(chunks:, close: ->{}) @chunks = chunks @close = close end |
Instance Method Details
#close ⇒ Object
14 15 16 |
# File 'lib/tus/response.rb', line 14 def close @close.call end |
#each(&block) ⇒ Object
10 11 12 |
# File 'lib/tus/response.rb', line 10 def each(&block) @chunks.each(&block) end |