Class: FeatureHub::Sdk::Impl::BooleanMatcher

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

Overview

comparison for true/false

Instance Method Summary collapse

Instance Method Details

#match(supplied_value, attr) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/feature_hub/sdk/impl/strategy_wrappers.rb', line 17

def match(supplied_value, attr)
  val = supplied_value.downcase == "true"

  if attr.conditional.equals?
    val == (attr.values[0].to_s.downcase == "true")
  elsif attr.conditional.not_equals?
    val != (attr.values[0].to_s.downcase == "true")
  else
    false
  end
end