Class: Webmachine::Streaming::CallableEncoder Private
- Defined in:
- lib/webmachine/streaming/callable_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 callable bodies, such as Proc. (essentially futures)
Instance Attribute Summary
Attributes inherited from Encoder
#body, #charsetter, #encoder, #resource
Instance Method Summary collapse
-
#call ⇒ String
private
Encodes the output of the body Proc.
-
#to_proc ⇒ Proc
private
Converts this encoder into a Proc.
Methods inherited from Encoder
Constructor Details
This class inherits a constructor from Webmachine::Streaming::Encoder
Instance Method Details
#call ⇒ String
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.
Encodes the output of the body Proc.
9 10 11 |
# File 'lib/webmachine/streaming/callable_encoder.rb', line 9 def call resource.send(encoder, resource.send(charsetter, body.call.to_s)) end |
#to_proc ⇒ Proc
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.
Converts this encoder into a Proc.
16 17 18 |
# File 'lib/webmachine/streaming/callable_encoder.rb', line 16 def to_proc method(:call).to_proc end |