Module: Risenexa::Tracking
- Defined in:
- lib/risenexa/tracking.rb,
lib/risenexa/tracking/client.rb,
lib/risenexa/tracking/errors.rb,
lib/risenexa/tracking/result.rb,
lib/risenexa/tracking/version.rb,
lib/risenexa/tracking/http_client.rb,
lib/risenexa/tracking/configuration.rb
Overview
The Risenexa Tracking module provides global configuration and module-level convenience methods that delegate to a lazily-created Client instance.
Defined Under Namespace
Classes: AuthenticationError, AuthorizationError, Client, Configuration, ConfigurationError, ConnectionError, Error, HttpClient, MaxRetriesExceededError, RateLimitError, Result, StartupNotFoundError, ValidationError
Constant Summary collapse
- VERSION =
"0.1.0"
Class Attribute Summary collapse
-
.configuration ⇒ Configuration?
The current global configuration.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Object
Configure the SDK globally.
-
.reset_configuration! ⇒ Object
Reset global configuration and the cached client instance.
-
.track(**params) ⇒ Result
Low-level track method using the global configuration.
-
.track_conversion(user_id:, **opts) ⇒ Result
Track a user conversion event using the global configuration.
-
.track_registration(user_id:, **opts) ⇒ Result
Track a user registration event using the global configuration.
Class Attribute Details
.configuration ⇒ Configuration?
Returns the current global configuration.
29 30 31 |
# File 'lib/risenexa/tracking.rb', line 29 def configuration @configuration end |
Class Method Details
.configure {|config| ... } ⇒ Object
Configure the SDK globally.
34 35 36 37 38 |
# File 'lib/risenexa/tracking.rb', line 34 def configure self.configuration ||= Configuration.new yield(configuration) self.configuration end |
.reset_configuration! ⇒ Object
Reset global configuration and the cached client instance. Useful for test isolation.
42 43 44 45 |
# File 'lib/risenexa/tracking.rb', line 42 def reset_configuration! self.configuration = nil @client = nil end |
.track(**params) ⇒ Result
Low-level track method using the global configuration.
72 73 74 |
# File 'lib/risenexa/tracking.rb', line 72 def track(**params) client.track(**params) end |
.track_conversion(user_id:, **opts) ⇒ Result
Track a user conversion event using the global configuration.
63 64 65 |
# File 'lib/risenexa/tracking.rb', line 63 def track_conversion(user_id:, **opts) client.track_conversion(user_id: user_id, **opts) end |
.track_registration(user_id:, **opts) ⇒ Result
Track a user registration event using the global configuration.
53 54 55 |
# File 'lib/risenexa/tracking.rb', line 53 def track_registration(user_id:, **opts) client.track_registration(user_id: user_id, **opts) end |