Module: LaunchDarkly::Interfaces::Plugins::Plugin
- Defined in:
- lib/ldclient-rb/interfaces/plugins.rb
Overview
Mixin for extending SDK functionality via plugins.
All provided plugin implementations MUST include this mixin. Plugins without this mixin will be ignored.
This mixin includes default implementations for optional methods. This allows LaunchDarkly to expand the list of plugin methods without breaking customer integrations.
Plugins provide an interface which allows for initialization, access to credentials, and hook registration in a single interface.
Instance Method Summary collapse
-
#get_hooks(environment_metadata) ⇒ Array<Interfaces::Hooks::Hook>
Get a list of hooks that this plugin provides.
-
#metadata ⇒ PluginMetadata
Get metadata about the plugin implementation.
-
#register(client, environment_metadata) ⇒ void
Register the plugin with the SDK client.
Instance Method Details
#get_hooks(environment_metadata) ⇒ Array<Interfaces::Hooks::Hook>
Get a list of hooks that this plugin provides.
This method is called before register() to collect all hooks from plugins. The hooks returned will be added to the SDK's hook configuration.
130 131 132 |
# File 'lib/ldclient-rb/interfaces/plugins.rb', line 130 def get_hooks() [] end |
#metadata ⇒ PluginMetadata
Get metadata about the plugin implementation.
103 104 105 |
# File 'lib/ldclient-rb/interfaces/plugins.rb', line 103 def PluginMetadata.new('UNDEFINED') end |
#register(client, environment_metadata) ⇒ void
This method returns an undefined value.
Register the plugin with the SDK client.
This method is called during SDK initialization to allow the plugin to set up any necessary integrations, register hooks, or perform other initialization tasks.
117 118 119 |
# File 'lib/ldclient-rb/interfaces/plugins.rb', line 117 def register(client, ) # Default implementation does nothing end |