Class: ActionView::StreamingTemplateRenderer::Body
- Inherits:
-
Object
- Object
- ActionView::StreamingTemplateRenderer::Body
- Defined in:
- lib/action_view/renderer/streaming_template_renderer.rb
Overview
A valid Rack::Body (i.e. it responds to each). It is initialized with a block that, when called, starts rendering the template.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(&start) ⇒ Body
constructor
:nodoc:.
Constructor Details
#initialize(&start) ⇒ Body
:nodoc:
14 15 16 |
# File 'lib/action_view/renderer/streaming_template_renderer.rb', line 14 def initialize(&start) @start = start end |
Instance Method Details
#each(&block) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/action_view/renderer/streaming_template_renderer.rb', line 18 def each(&block) begin @start.call(block) rescue Exception => exception log_error(exception) block.call ActionView::Base.streaming_completion_on_exception end self end |