Sha256: 65b05a31c36a7d764ca3983401a313cbd2ec8b4d56388256fd888f894e871414

Contents?: true

Size: 307 Bytes

Versions: 2

Compression:

Stored size: 307 Bytes

Contents

# frozen_string_literal: true

module RangeScan
  class Matcher
    attr_reader :regexp

    def initialize(regexp)
      @regexp = Regexp.new(regexp)
    end

    def filter(results)
      results.select do |result|
        body = result.dig(:body) || ""
        body =~ regexp
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rangescan-0.1.1 lib/rangescan/matcher.rb
rangescan-0.1.0 lib/rangescan/matcher.rb