Sha256: 88340f17ed5a37f10fe9716f58eb35e231e76ee7d5aca0560c924b2209ce9c64
Contents?: true
Size: 1.17 KB
Versions: 62
Compression:
Stored size: 1.17 KB
Contents
module SplitIoClient # # class to implement the negation of a matcher # class NegationMatcher MATCHER_TYPE = 'NEGATION_MATCHER'.freeze def initialize(matcher = nil) @matcher = matcher end # # evaluates if the key matches the negation of the matcher # # @param key [string] key value to be matched # # @return [boolean] evaluation of the negation matcher def match?(args) !@matcher.match?(args) end def respond_to?(method) @matcher.respond_to? method end def attribute @matcher.attribute end def string_type? @matcher.string_type? 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 !obj.instance_of?(NegationMatcher) false elsif self.equal?(obj) true else false end end # # function to print string value for this matcher # # @reutrn [string] string value of this matcher def to_s "not #{@matcher}" end end end
Version data entries
62 entries across 62 versions & 1 rubygems