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_name, target, variation_identifier) ⇒ 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_name, target, variation_identifier)

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

  @metrics_processor.register_evaluation(target, feature_name, variation_identifier)
end