Class: TurboStreamer::Handler
- Inherits:
-
Object
- Object
- TurboStreamer::Handler
- Defined in:
- lib/turbostreamer/handler.rb
Class Method Summary collapse
-
.call(template, source = nil) ⇒ Object
TODO: setting source=nil is for rails 5.x compatability, once unsppored source can be a required param and ‘source = template.source if source.nil?` can be removed.
- .supports_streaming? ⇒ Boolean
Class Method Details
.call(template, source = nil) ⇒ Object
TODO: setting source=nil is for rails 5.x compatability, once unsppored source can be a required param and ‘source = template.source if source.nil?` can be removed
18 19 20 21 22 23 |
# File 'lib/turbostreamer/handler.rb', line 18 def self.call(template, source=nil) source = template.source if source.nil? # 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
11 12 13 |
# File 'lib/turbostreamer/handler.rb', line 11 def self.supports_streaming? true end |