Class: ActionView::OutputFlow
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Inherits: | Object |
Defined in: | actionview/lib/action_view/flows.rb |
Class Method Summary
- .new ⇒ OutputFlow constructor
Instance Attribute Summary
- #content readonly
Instance Method Summary
-
#append(key, value)
(also: #append!)
Called by content_for.
-
#append!(key, value)
Alias for #append.
-
#get(key)
Called by _layout_for to read stored values.
-
#set(key, value)
Called by each renderer object to set the layout contents.
Constructor Details
.new ⇒ OutputFlow
# 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 (readonly)
[ GitHub ]# File 'actionview/lib/action_view/flows.rb', line 7
attr_reader :content
Instance Method Details
#append(key, value) Also known as: #append!
Called by content_for
# File 'actionview/lib/action_view/flows.rb', line 24
def append(key, value) @content[key] << value.to_s end
#append!(key, value)
Alias for #append.
# File 'actionview/lib/action_view/flows.rb', line 27
alias_method :append!, :append
#get(key)
Called by _layout_for to read stored values.
# File 'actionview/lib/action_view/flows.rb', line 14
def get(key) @content[key] end
#set(key, value)
Called by each renderer object to set the layout contents.
# File 'actionview/lib/action_view/flows.rb', line 19
def set(key, value) @content[key] = ActiveSupport::SafeBuffer.new(value.to_s) end