Sha256: b3cfb9e8d4f8b87970822ec233445f79801cbd0232c788295067f779bcd6e373

Contents?: true

Size: 413 Bytes

Versions: 1

Compression:

Stored size: 413 Bytes

Contents

class FuzzyMatch
  # A rule characterized by a regexp. Abstract.
  class Rule
    attr_reader :regexp
    
    def initialize(regexp)
      unless regexp.is_a?(::Regexp)
        raise ArgumentError, "[FuzzyMatch] Rules must be set with Regexp objects, but got #{regexp.inspect} (#{regexp.class.name})"
      end
      @regexp = regexp
    end
    
    def ==(other)
      regexp == other.regexp
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fuzzy_match-1.5.0 lib/fuzzy_match/rule.rb