Class: ActionView::OutputFlow
- Inherits:
-
Object
- Object
- ActionView::OutputFlow
- Defined in:
- 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.
7 8 9 |
# File 'lib/action_view/flows.rb', line 7 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.
5 6 7 |
# File 'lib/action_view/flows.rb', line 5 def content @content end |
Instance Method Details
#append(key, value) ⇒ Object Also known as: append!
Called by content_for
22 23 24 |
# File 'lib/action_view/flows.rb', line 22 def append(key, value) @content[key] << value end |
#get(key) ⇒ Object
Called by _layout_for to read stored values.
12 13 14 |
# File 'lib/action_view/flows.rb', line 12 def get(key) @content[key] end |
#set(key, value) ⇒ Object
Called by each renderer object to set the layout contents.
17 18 19 |
# File 'lib/action_view/flows.rb', line 17 def set(key, value) @content[key] = value end |