Class: SplitIoClient::Helpers::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/splitclient-rb/helpers/util.rb

Class Method Summary collapse

Class Method Details

.segment_names_by_feature_flag(feature_flag) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/splitclient-rb/helpers/util.rb', line 6

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