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
196 def initialize(scope)
197   @scope = scope
198 end

Public Instance methods

each(&block)

Yield each non-empty chunk as the body.

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