Sha256: 2a576e4703131aeb4599ebd56a7840c82351e692cf6a77bfdc8989fe7d60523c

Contents?: true

Size: 970 Bytes

Versions: 35

Compression:

Stored size: 970 Bytes

Contents

module SplitIoClient

  #
  # class to implement the all keys matcher
  #
  class AllKeysMatcher < NoMethodError

    attr_reader :matcher_type

    def initialize
      @matcher_type = "ALL_KEYS"
    end

    #
    # evaluates if the key matches the matcher
    #
    # @param key [string] key value to be matched
    #
    # @return [boolean] true for all instances
    def match?(key, attributes)
      true
    end

    #
    # evaluates if the given object equals the matcher
    #
    # @param obj [object] object to be evaluated
    #
    # @returns [boolean] true if obj equals the matcher
    def equals?(obj)
      if obj.nil?
        false
      elsif self.equal?(obj)
        true
      elsif !obj.instance_of?(AllKeysMatcher)
        false
      else
        true
      end
    end

    #
    # function to print string value for this matcher
    #
    # @reutrn [string] string value of this matcher
    def to_s
      'in segment all'
    end

  end

end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
splitclient-rb-3.2.4.pre.rc3 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.2.4.pre.rc2 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.2.4.pre.rc1 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.2.3 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.2.3.pre.rc1 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.2.2 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.2.1 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.2.0 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.3 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.3.pre.rc3 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.3.pre.rc2 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.3.pre.rc1 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.2 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.1 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.0 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.0.pre.rc12 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.0.pre.rc11 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.0.pre.rc10 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.0.pre.rc9 lib/engine/matchers/all_keys_matcher.rb
splitclient-rb-3.1.0.pre.rc8 lib/engine/matchers/all_keys_matcher.rb