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

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.

Parameters:

  • environment_metadata (EnvironmentMetadata)

    Metadata about the environment in which the SDK is running

Returns:



130
131
132
# File 'lib/ldclient-rb/interfaces/plugins.rb', line 130

def get_hooks()
  []
end

#metadataPluginMetadata

Get metadata about the plugin implementation.

Returns:



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.

Parameters:

  • client (LDClient)

    The LDClient instance

  • environment_metadata (EnvironmentMetadata)

    Metadata about the environment in which the SDK is running



117
118
119
# File 'lib/ldclient-rb/interfaces/plugins.rb', line 117

def register(client, )
  # Default implementation does nothing
end