Exception: SplitIoClient::AllKeysMatcher

Inherits:
NoMethodError
  • Object
show all
Defined in:
lib/engine/matchers/all_keys_matcher.rb

Overview

class to implement the all keys matcher

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ AllKeysMatcher

Returns a new instance of AllKeysMatcher.



8
9
10
# File 'lib/engine/matchers/all_keys_matcher.rb', line 8

def initialize
  @matcher_type = 'ALL_KEYS'
end

Instance Attribute Details

#matcher_type ⇒ Object (readonly)

Returns the value of attribute matcher_type.



6
7
8
# File 'lib/engine/matchers/all_keys_matcher.rb', line 6

def matcher_type
  @matcher_type
end

Instance Method Details

#equals?(obj) ⇒ Boolean

evaluates if the given object equals the matcher

Parameters:

  • obj (object) —

    object to be evaluated

Returns:

  • (Boolean)


28
29
30
31
32
33
34
35
36
37
38
# File 'lib/engine/matchers/all_keys_matcher.rb', line 28

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

#match?(_key, _attributes) ⇒ boolean

evaluates if the key matches the matcher

Parameters:

  • key (string) —

    key value to be matched

Returns:

  • (boolean) —

    true for all instances



18
19
20
# File 'lib/engine/matchers/all_keys_matcher.rb', line 18

def match?(_key, _attributes)
  true
end

#to_s ⇒ Object

function to print string value for this matcher



44
45
46
# File 'lib/engine/matchers/all_keys_matcher.rb', line 44

def to_s
  'in segment all'
end