Class: ActionView::StreamingBuffer
- Inherits:
-
Object
- Object
- ActionView::StreamingBuffer
- Defined in:
- lib/action_view/buffers.rb
Overview
:nodoc:
Instance Method Summary collapse
- #<<(value) ⇒ Object (also: #concat, #append=)
- #html_safe ⇒ Object
- #html_safe? ⇒ Boolean
-
#initialize(block) ⇒ StreamingBuffer
constructor
A new instance of StreamingBuffer.
- #safe_concat(value) ⇒ Object (also: #safe_append=)
Constructor Details
#initialize(block) ⇒ StreamingBuffer
Returns a new instance of StreamingBuffer.
27 28 29 |
# File 'lib/action_view/buffers.rb', line 27 def initialize(block) @block = block end |
Instance Method Details
#<<(value) ⇒ Object Also known as: concat, append=
31 32 33 34 35 |
# File 'lib/action_view/buffers.rb', line 31 def <<(value) value = value.to_s value = ERB::Util.h(value) unless value.html_safe? @block.call(value) end |
#html_safe ⇒ Object
48 49 50 |
# File 'lib/action_view/buffers.rb', line 48 def html_safe self end |
#html_safe? ⇒ Boolean
44 45 46 |
# File 'lib/action_view/buffers.rb', line 44 def html_safe? true end |
#safe_concat(value) ⇒ Object Also known as: safe_append=
39 40 41 |
# File 'lib/action_view/buffers.rb', line 39 def safe_concat(value) @block.call(value.to_s) end |