Class: SplitIoClient::AllKeysMatcher

Inherits:
Object
  • 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'.freeze

Instance Method Summary collapse

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



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

def equals?(obj)
  if obj.nil?
    false
  elsif equal?(obj)
    true
  elsif !obj.instance_of?(AllKeysMatcher)
    false
  else
    true
  end
end

#match?(_args) ⇒ boolean

evaluates if the key matches the matcher

Returns:

  • (boolean)

    true for all instances



12
13
14
# File 'lib/splitclient-rb/engine/matchers/all_keys_matcher.rb', line 12

def match?(_args)
  true
end

#string_type?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/splitclient-rb/engine/matchers/all_keys_matcher.rb', line 34

def string_type?
  false
end

#to_sObject

function to print string value for this matcher



42
43
44
# File 'lib/splitclient-rb/engine/matchers/all_keys_matcher.rb', line 42

def to_s
  'in segment all'
end