Sha256: a403ec8f27faf1283b4c43a34c94b873ac8d23519ae360dd044be7993e675bda
Contents?: true
Size: 501 Bytes
Versions: 12
Compression:
Stored size: 501 Bytes
Contents
# frozen_string_literal: true module PageMagic class Comparator # class Fuzzy - used for modeling and comparing components that are 'fuzzy' i.e. respond to `=~` e.g. a Regexp class Fuzzy < Comparator def initialize(comparator) super(comparator, true) end def match?(value) comparator =~ value ? true : false end def <=>(other) return -1 if other.is_a?(Null) return 1 unless other.fuzzy? 0 end end end end
Version data entries
12 entries across 12 versions & 1 rubygems