module StubRequests::Utils::Fuzzy

Provides convenience methods for hashes

@author Mikael Henriksson <mikael@zoolutions.se>

Constants

FILTER_REGEX

@return [Regexp] a pattern excluding all except alphanumeric

Public Class Methods

match(original, others) click to toggle source

Find strings that are similar

@param [String] original a string to match @param [Array<String>] others an array of string to search

@return [Array] Returns

# File lib/stub_requests/utils/fuzzy.rb, line 34
def self.match(original, others)
  matches = compute_distances(original, others).sort.reverse
  filter_matches(matches.to_h)
end