Class: ActionView::OutputFlow
- Defined in:
- actionview/lib/action_view/flows.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
-
#append(key, value) ⇒ Object
(also: #append!)
Called by content_for.
-
#get(key) ⇒ Object
Called by _layout_for to read stored values.
-
#initialize ⇒ OutputFlow
constructor
A new instance of OutputFlow.
-
#set(key, value) ⇒ Object
Called by each renderer object to set the layout contents.
Constructor Details
#initialize ⇒ OutputFlow
Returns a new instance of OutputFlow.
9 10 11 |
# File 'actionview/lib/action_view/flows.rb', line 9 def initialize @content = Hash.new { |h, k| h[k] = ActiveSupport::SafeBuffer.new } end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content
7 8 9 |
# File 'actionview/lib/action_view/flows.rb', line 7 def content @content end |
Instance Method Details
#append(key, value) ⇒ Object Also known as: append!
Called by content_for
24 25 26 |
# File 'actionview/lib/action_view/flows.rb', line 24 def append(key, value) @content[key] << value.to_s end |
#get(key) ⇒ Object
Called by _layout_for to read stored values.
14 15 16 |
# File 'actionview/lib/action_view/flows.rb', line 14 def get(key) @content[key] end |
#set(key, value) ⇒ Object
Called by each renderer object to set the layout contents.
19 20 21 |
# File 'actionview/lib/action_view/flows.rb', line 19 def set(key, value) @content[key] = ActiveSupport::SafeBuffer.new(value.to_s) end |