Class: Webmachine::Streaming::EnumerableEncoder Private
- Includes:
- Enumerable
- Defined in:
- lib/webmachine/streaming/enumerable_encoder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Implements a streaming encoder for Enumerable response bodies, such as Arrays.
Instance Attribute Summary
Attributes inherited from Encoder
#body, #charsetter, #encoder, #resource
Instance Method Summary collapse
-
#each {|chunk| ... } ⇒ Object
private
Iterates over the body, encoding and yielding individual chunks of the response entity.
Methods inherited from Encoder
Constructor Details
This class inherits a constructor from Webmachine::Streaming::Encoder
Instance Method Details
#each {|chunk| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Iterates over the body, encoding and yielding individual chunks of the response entity.
13 14 15 16 17 |
# File 'lib/webmachine/streaming/enumerable_encoder.rb', line 13 def each body.each do |block| yield resource.send(encoder, resource.send(charsetter, block.to_s)) end end |