Sha256: 64a1ff0083f232c490e25b9c0b56991f3a783e88e58b2416822701919b33e64a

Contents?: true

Size: 1.05 KB

Versions: 6

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module SplitIoClient
  #
  # class to implement the all keys matcher
  #
  class Matcher
    def initialize(logger)
      @logger = logger
    end

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

    def string_type?
      false
    end

    private

    def verify_semver_arg?(args, matcher_name)
      @logger.debug("[#{matcher_name}] evaluating value and attributes.")
      return false unless @validator.valid_matcher_arguments(args)

      true
    end

    def check_semver_value_to_match(value_to_match, matcher_spec_name)
      if value_to_match.nil? || @semver.nil?
        @logger.error("stringMatcherData is required for #{matcher_spec_name} matcher type")
        return false

      end
      true
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
splitclient-rb-8.4.0-java lib/splitclient-rb/engine/matchers/matcher.rb
splitclient-rb-8.4.0 lib/splitclient-rb/engine/matchers/matcher.rb
splitclient-rb-8.4.0.pre.rc1-java lib/splitclient-rb/engine/matchers/matcher.rb
splitclient-rb-8.4.0.pre.rc1 lib/splitclient-rb/engine/matchers/matcher.rb
splitclient-rb-8.4.0.rc.1-java lib/splitclient-rb/engine/matchers/matcher.rb
splitclient-rb-8.4.0.rc.1 lib/splitclient-rb/engine/matchers/matcher.rb