Class: FeatureHub::Sdk::Impl::MatcherRegistry

Inherits:
MatcherRepository show all
Defined in:
lib/feature_hub/sdk/impl/strategy_wrappers.rb

Overview

figures out what attribute type this is and passes back the right matcher

Instance Method Summary collapse

Instance Method Details

#find_matcher(attr) ⇒ Object



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/feature_hub/sdk/impl/strategy_wrappers.rb', line 162

def find_matcher(attr)
  case attr.field_type
  when "BOOLEAN"
    BooleanMatcher.new
  when "STRING", "DATE", "DATE_TIME"
    StringMatcher.new
  when "SEMANTIC_VERSION"
    SemanticVersionMatcher.new
  when "NUMBER"
    NumberMatcher.new
  when "IP_ADDRESS"
    IpNetworkMatcher.new
  else
    StrategyMatcher.new
  end
end