Class: ActionView::OutputFlow

Inherits:
Object
  • Object
show all
Defined in:
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.



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

#contentObject (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] = ActiveSupport::SafeBuffer.new(value)
end