Class: TurboStreamer::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/turbostreamer/handler.rb

Class Method Summary collapse

Class Method Details

.call(template, source) ⇒ Object



16
17
18
19
20
# File 'lib/turbostreamer/handler.rb', line 16

def self.call(template, source)
  # this juggling is required to keep line numbers right in the error
  %{__already_defined = defined?(json); json||=TurboStreamer::Template.new(self, output_buffer: output_buffer || ActionView::OutputBuffer.new); #{source}
    json.target! unless (__already_defined && __already_defined != "method")}
end

.supports_streaming?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/turbostreamer/handler.rb', line 12

def self.supports_streaming?
  true
end