Class: SplitIoClient::AllKeysMatcher

Inherits:
Matcher
  • Object
show all
Defined in:
lib/splitclient-rb/engine/matchers/all_keys_matcher.rb

Overview

class to implement the all keys matcher

Constant Summary collapse

MATCHER_TYPE =
'ALL_KEYS'

Instance Method Summary collapse

Methods inherited from Matcher

#initialize, #string_type?

Constructor Details

This class inherits a constructor from SplitIoClient::Matcher

Instance Method Details

#equals?(obj) ⇒ boolean

evaluates if the given object equals the matcher

Parameters:

  • obj (object)

    object to be evaluated

Returns:

  • (boolean)

    true if obj equals the matcher



25
26
27
28
29
30
31
# File 'lib/splitclient-rb/engine/matchers/all_keys_matcher.rb', line 25

def equals?(obj)
  if obj.instance_of?(AllKeysMatcher)
    true
  else
    super(obj)
  end
end

#match?(_args) ⇒ boolean

evaluates if the key matches the matcher

Returns:

  • (boolean)

    true for all instances



14
15
16
17
# File 'lib/splitclient-rb/engine/matchers/all_keys_matcher.rb', line 14

def match?(_args)
  @logger.log_if_debug('[AllKeysMatcher] is always -> true')
  true
end

#to_sstring

function to print string value for this matcher

Returns:

  • (string)

    string value of this matcher



37
38
39
# File 'lib/splitclient-rb/engine/matchers/all_keys_matcher.rb', line 37

def to_s
  'in segment all'
end