Class: ActionView::StreamingBuffer
- Inherits:
-
Object
- Object
- ActionView::StreamingBuffer
- Defined in:
- actionpack/lib/action_view/buffers.rb
Overview
:nodoc:
Instance Method Summary (collapse)
- - (Object) <<(value) (also: #concat, #append=)
- - (Object) html_safe
- - (Boolean) html_safe?
-
- (StreamingBuffer) initialize(block)
constructor
A new instance of StreamingBuffer.
- - (Object) safe_concat(value) (also: #safe_append=)
Constructor Details
- (StreamingBuffer) initialize(block)
A new instance of StreamingBuffer
18 19 20 |
# File 'actionpack/lib/action_view/buffers.rb', line 18 def initialize(block) @block = block end |
Instance Method Details
- (Object) <<(value) Also known as: concat, append=
22 23 24 25 26 |
# File 'actionpack/lib/action_view/buffers.rb', line 22 def <<(value) value = value.to_s value = ERB::Util.h(value) unless value.html_safe? @block.call(value) end |
- (Object) html_safe
39 40 41 |
# File 'actionpack/lib/action_view/buffers.rb', line 39 def html_safe self end |
- (Boolean) html_safe?
35 36 37 |
# File 'actionpack/lib/action_view/buffers.rb', line 35 def html_safe? true end |
- (Object) safe_concat(value) Also known as: safe_append=
30 31 32 |
# File 'actionpack/lib/action_view/buffers.rb', line 30 def safe_concat(value) @block.call(value.to_s) end |