From 31cfd5e4fdd0017f101af8f2f3d6b52b6ea68c08 Mon Sep 17 00:00:00 2001 From: schneems Date: Thu, 6 Sep 2018 12:00:20 -0500 Subject: [ci skip] Doc ActionView::OutputBuffer --- actionview/lib/action_view/buffers.rb | 15 +++++++++++++++ actionview/lib/action_view/helpers/capture_helper.rb | 5 ++--- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/buffers.rb b/actionview/lib/action_view/buffers.rb index 2a378fdc3c..18eaee5d79 100644 --- a/actionview/lib/action_view/buffers.rb +++ b/actionview/lib/action_view/buffers.rb @@ -3,6 +3,21 @@ require "active_support/core_ext/string/output_safety" module ActionView + # Used as a buffer for views + # + # The main difference between this and ActiveSupport::SafeBuffer + # is for the methods `<<` and `safe_expr_append=` the inputs are + # checked for nil before they are assigned and `to_s` is called on + # the input. For example: + # + # obuf = ActionView::OutputBuffer.new "hello" + # obuf << 5 + # puts obuf # => "hello5" + # + # sbuf = ActiveSupport::SafeBuffer.new "hello" + # sbuf << 5 + # puts sbuf # => "hello\u0005" + # class OutputBuffer < ActiveSupport::SafeBuffer #:nodoc: def initialize(*) super diff --git a/actionview/lib/action_view/helpers/capture_helper.rb b/actionview/lib/action_view/helpers/capture_helper.rb index 63707280a3..c87c212cc7 100644 --- a/actionview/lib/action_view/helpers/capture_helper.rb +++ b/actionview/lib/action_view/helpers/capture_helper.rb @@ -36,10 +36,9 @@ module ActionView # # # - # The output of `capture` is the rendered string. For Example: + # The return of capture is the string generated by the block. For Example: # - # puts @greeting - # # => "Welcome to my shiny new web page! The date and time is 2018-09-06 11:09:16 -0500" + # @greeting # => "Welcome to my shiny new web page! The date and time is 2018-09-06 11:09:16 -0500" # def capture(*args) value = nil -- cgit v1.2.3