Class: ActionView::Template::Handlers::ERB::ThreadSafeErubi

Inherits:
Erubi
  • Object
show all
Defined in:
lib/async_partial/handlers/erubi.rb

Instance Method Summary collapse

Constructor Details

#initialize(input, properties = {}) ⇒ ThreadSafeErubi

Returns a new instance of ThreadSafeErubi.



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/async_partial/handlers/erubi.rb', line 8

def initialize(input, properties = {})
  @newline_pending = 0

  # Dup properties so that we don't modify argument
  properties = Hash[properties]
  properties[:preamble]   = "output_buffer ||= ActionView::OutputBuffer.new;"
  properties[:postamble]  = "output_buffer.to_s"
  properties[:bufvar]     = "output_buffer"
  properties[:escapefunc] = ""

  # Call ::Erubi::Engine#initializer
  method(__method__).super_method.super_method.call input, properties
end