Class: BetterAuth::Telemetry::NoopPublisher
- Inherits:
-
Object
- Object
- BetterAuth::Telemetry::NoopPublisher
- Defined in:
- lib/better_auth/telemetry/noop_publisher.rb
Overview
Publisher returned from create when telemetry is disabled, when no ‘BETTER_AUTH_TELEMETRY_ENDPOINT` is configured and no `custom_track` is supplied, or when the soft-load fallback inside Auth#initialize cannot load the telemetry gem.
Calling ‘#publish` on a `NoopPublisher` is always safe: the method accepts any event-shaped argument, performs no work, raises no error, and returns `nil`. `#enabled?` always reports `false`. This lets callers treat `auth.telemetry` as a non-nullable, always-callable collaborator without having to nil-check before each `publish` call.
Instance Method Summary collapse
-
#enabled? ⇒ Boolean
Always ‘false`.
- #publish(_event) ⇒ nil
Instance Method Details
#enabled? ⇒ Boolean
Returns always ‘false`.
28 29 30 |
# File 'lib/better_auth/telemetry/noop_publisher.rb', line 28 def enabled? false end |
#publish(_event) ⇒ nil
23 24 25 |
# File 'lib/better_auth/telemetry/noop_publisher.rb', line 23 def publish(_event) nil end |