lib/aspecto/opentelemetry/sampler/operator.rb in aspecto-opentelemetry-0.1.10 vs lib/aspecto/opentelemetry/sampler/operator.rb in aspecto-opentelemetry-0.2.0.rc0
- old
+ new
@@ -5,10 +5,10 @@
module OpenTelemetry
# Sampling logic for aspecto otel distribution
module Sampler
# A single operator used to evaluate sampling rules
class Operator
- def initialize(operator, expected) # rubocop:disable Metrics/AbcSize
+ def initialize(operator, expected) # rubocop:disable Metrics/AbcSize
@expected = expected&.downcase
@expected = Regexp.new(@expected) if operator == "matches"
operator_to_proc = {
"eq" => proc { |actual| @expected == actual },