Class: Rack::Chunker
- Inherits:
-
Object
- Object
- Rack::Chunker
- Defined in:
- lib/rack/chunker.rb,
lib/rack/chunker/version.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Instance Method Summary collapse
- #call(previous_state) ⇒ Object
-
#initialize(stack, bitsize = false) ⇒ Chunker
constructor
A new instance of Chunker.
Constructor Details
#initialize(stack, bitsize = false) ⇒ Chunker
Returns a new instance of Chunker.
8 9 10 11 |
# File 'lib/rack/chunker.rb', line 8 def initialize(stack, bitsize = false) @stack = stack @bitsize = bitsize end |
Instance Method Details
#call(previous_state) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rack/chunker.rb', line 13 def call(previous_state) @state = previous_state @status, @headers, @body = stack.call(state) if body.is_a?(Array) [status, headers, body] else [status, headers, [body]] end end |