Sha256: 3fa93f2b773d9d1b0857ff620ad275fb577bd2b10be1007c2dafbbd771cb582e
Contents?: true
Size: 662 Bytes
Versions: 16
Compression:
Stored size: 662 Bytes
Contents
# encoding: utf-8 module Adhearsion class CallController module MenuDSL class ArrayMatchCalculator < MatchCalculator def match(query) args = { :query => query, :exact_matches => [], :potential_matches => [] } pattern.compact.each do |pat| pattern_string = pat.to_s query_string = query.to_s if pattern_string == query_string args[:exact_matches] << pat elsif pattern_string.starts_with? query_string args[:potential_matches] << pat end end new_calculated_match args end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems