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

#initializeAllKeysMatcher

Returns a new instance of AllKeysMatcher.



10
11
12
# File 'lib/engine/matchers/all_keys_matcher.rb', line 10

def initialize
  @matcher_type = "ALL_KEYS"
end

Instance Attribute Details

#matcher_typeObject (readonly)

Returns the value of attribute matcher_type.



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

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)


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

def equals?(obj)
  if obj.nil?
    false
  elsif self.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



20
21
22
# File 'lib/engine/matchers/all_keys_matcher.rb', line 20

def match?(key, attributes)
  true
end

#to_sObject

function to print string value for this matcher



46
47
48
# File 'lib/engine/matchers/all_keys_matcher.rb', line 46

def to_s
  'in segment all'
end