lib/engine/parser/condition.rb in splitclient-rb-4.0.0 vs lib/engine/parser/condition.rb in splitclient-rb-4.1.0.pre.rc1

- old
+ new

@@ -106,9 +106,52 @@ end_value = (matcher[:betweenMatcherData])[:end] data_type = (matcher[:betweenMatcherData])[:dataType] BetweenMatcher.new(attribute: attribute, start_value: start_value, end_value: end_value, data_type: data_type) end + + def matcher_part_of_set(params) + PartOfSetMatcher.new( + params[:matcher][:keySelector][:attribute], + params[:matcher][:whitelistMatcherData][:whitelist] + ) + end + + def matcher_contains_all(params) + ContainsAllMatcher.new( + params[:matcher][:keySelector][:attribute], + params[:matcher][:whitelistMatcherData][:whitelist] + ) + end + + def matcher_contains_any(params) + ContainsAnyMatcher.new( + params[:matcher][:keySelector][:attribute], + params[:matcher][:whitelistMatcherData][:whitelist] + ) + end + + def matcher_starts_with(params) + StartsWithMatcher.new( + params[:matcher][:keySelector][:attribute], + params[:matcher][:whitelistMatcherData][:whitelist] + ) + end + + def matcher_contains(params) + ContainsMatcher.new( + params[:matcher][:keySelector][:attribute], + params[:matcher][:whitelistMatcherData][:whitelist] + ) + end + + def matcher_ends_with(params) + EndsWithMatcher.new( + params[:matcher][:keySelector][:attribute], + params[:matcher][:whitelistMatcherData][:whitelist] + ) + end + # # @return [object] the negate value for this condition def negate @data[:matcherGroup][:matchers].first[:negate] end