Sha256: c3514f978857c15af134dc226a0e4e03776dfa8d783f5edc83f80050b21262cd
Contents?: true
Size: 382 Bytes
Versions: 9
Compression:
Stored size: 382 Bytes
Contents
# frozen_string_literal: true module ProxES module Helpers module Indices def filter(asked, against) return against.map { |a| a.gsub(%r{\.\*}, '*') } if asked == ['*'] || asked == [] answer = [] against.each do |pattern| answer.concat asked.select { |idx| idx =~ %r{#{pattern}} } end answer end end end end
Version data entries
9 entries across 9 versions & 1 rubygems