Class: Tus::Response
- Inherits:
-
Object
show all
- Defined in:
- lib/tus/response.rb
Overview
Object that responds to #each, #length, and #close, suitable for returning as a Rack response body.
Instance Method Summary
collapse
Constructor Details
#initialize(chunks:, close: ->{}) ⇒ 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
|