lib/splitclient-rb/helpers/util.rb



# frozen_string_literal: true

module SplitIoClient
  module Helpers
    class Util
      def self.segment_names_by_feature_flag(feature_flag)
        feature_flag[:conditions].each_with_object(Set.new) do |condition, names|
          condition[:matcherGroup][:matchers].each do |matcher|
            next if matcher[:userDefinedSegmentMatcherData].nil?

            names << matcher[:userDefinedSegmentMatcherData][:segmentName]
          end
        end
      end
    end
  end
end