class Roda::RodaPlugins::Chunked::StreamBody

  1. lib/roda/plugins/chunked.rb
Superclass: Object

Rack response body instance for chunked responses not using Transfer-Encoding: chunked.

Methods

Public Class

  1. new

Public Instance

  1. each

Public Class methods

new(scope)

Save the scope of the current request handling.

[show source]
    # File lib/roda/plugins/chunked.rb
198 def initialize(scope)
199   @scope = scope
200 end

Public Instance methods

each(&block)

Yield each non-empty chunk as the body.

[show source]
    # File lib/roda/plugins/chunked.rb
203 def each(&block)
204   @scope.each_chunk do |chunk|
205     yield chunk if chunk && !chunk.empty?
206   end
207 end