Class: InnerClientFlagEvaluateCallback

Inherits:
FlagEvaluateCallback show all
Defined in:
lib/ff/ruby/server/sdk/api/inner_client_flag_evaluate_callback.rb

Instance Method Summary collapse

Constructor Details

#initialize(metrics_processor, logger = nil) ⇒ InnerClientFlagEvaluateCallback

Returns a new instance of InnerClientFlagEvaluateCallback.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ff/ruby/server/sdk/api/inner_client_flag_evaluate_callback.rb', line 6

def initialize(metrics_processor, logger = nil)

  unless metrics_processor.kind_of?(MetricsProcessor)

    raise "The 'metrics_processor' parameter must be of '" + MetricsProcessor.to_s + "' data type"
  end

  if logger != nil

    @logger = logger
  else

    @logger = Logger.new(STDOUT)
  end

  @metrics_processor = metrics_processor
end

Instance Method Details

#process_evaluation(feature_config, target, variation) ⇒ Object



24
25
26
27
28
29
# File 'lib/ff/ruby/server/sdk/api/inner_client_flag_evaluate_callback.rb', line 24

def process_evaluation(feature_config, target, variation)

  @logger.debug "Processing evaluation: #{feature_config&.feature || 'nil feature'}, #{target&.identifier || 'nil target'}"

  @metrics_processor.register_evaluation(target, feature_config, variation)
end