Class: ActionView::OutputFlow

Inherits:
Object
  • Object
show all
Defined in:
actionview/lib/action_view/flows.rb

Overview

:nodoc:

Direct Known Subclasses

StreamingFlow

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOutputFlow

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

#contentObject (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