Module: LaunchDarkly::Interfaces::Hooks::Hook

Defined in:
lib/ldclient-rb/interfaces.rb

Overview

Mixin for extending SDK functionality via hooks.

All provided hook implementations MUST include this mixin. Hooks without this mixin will be ignored.

This mixin includes default implementations for all hook handlers. This allows LaunchDarkly to expand the list of hook handlers without breaking customer integrations.

Instance Method Summary collapse

Instance Method Details

#after_evaluation(evaluation_series_context, data, detail) ⇒ Hash

The after method is called during the execution of the variation method after the flag value has been determined. The method is executed synchronously.

being performed. of the previous stage for a series. modified.

Parameters:

  • evaluation_series_context (EvaluationSeriesContext)

    Contains read-only information about the evaluation

  • data (Hash)

    A record associated with each stage of hook invocations. Each stage is called with the data

  • detail (LaunchDarkly::EvaluationDetail)

    The result of the evaluation. This value should not be

Returns:

  • (Hash)

    Data to use when executing the next state of the hook in the evaluation series.



934
935
936
# File 'lib/ldclient-rb/interfaces.rb', line 934

def after_evaluation(evaluation_series_context, data, detail)
  data
end

#before_evaluation(evaluation_series_context, data) ⇒ Hash

The before method is called during the execution of a variation method before the flag value has been determined. The method is executed synchronously.

performed. This is not mutable. of the previous stage for a series. The input record should not be modified.

Parameters:

  • evaluation_series_context (EvaluationSeriesContext)

    Contains information about the evaluation being

  • data (Hash)

    A record associated with each stage of hook invocations. Each stage is called with the data

Returns:

  • (Hash)

    Data to use when executing the next state of the hook in the evaluation series.



918
919
920
# File 'lib/ldclient-rb/interfaces.rb', line 918

def before_evaluation(evaluation_series_context, data)
  data
end

#metadataMetadata

Get metadata about the hook implementation.

Returns:



904
905
906
# File 'lib/ldclient-rb/interfaces.rb', line 904

def 
  Metadata.new('UNDEFINED')
end