Module: Turbo

Extended by:
ActiveSupport::Autoload
Defined in:
lib/turbo-rails.rb,
lib/turbo/engine.rb,
lib/turbo/version.rb,
lib/turbo/test_assertions.rb,
lib/turbo/broadcastable/test_helper.rb,
lib/turbo/test_assertions/integration_test_assertions.rb

Defined Under Namespace

Modules: Broadcastable, DriveHelper, FramesHelper, IncludesHelper, RequestIdTracking, StreamsHelper, TestAssertions Classes: Debouncer, Engine, StreamsChannel, ThreadDebouncer

Constant Summary collapse

VERSION =
"2.0.5"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.signed_stream_verifier_keyObject



18
19
20
# File 'lib/turbo-rails.rb', line 18

def signed_stream_verifier_key
  @signed_stream_verifier_key or raise ArgumentError, "Turbo requires a signed_stream_verifier_key"
end

Class Method Details

.signed_stream_verifierObject



14
15
16
# File 'lib/turbo-rails.rb', line 14

def signed_stream_verifier
  @signed_stream_verifier ||= ActiveSupport::MessageVerifier.new(signed_stream_verifier_key, digest: "SHA256", serializer: JSON)
end

.with_request_id(request_id) ⇒ Object



22
23
24
25
26
27
# File 'lib/turbo-rails.rb', line 22

def with_request_id(request_id)
  old_request_id, self.current_request_id = self.current_request_id, request_id
  yield
ensure
  self.current_request_id = old_request_id
end