Module: Olyx::Guardrails::Secrets::RegexpFindingSource

Defined in:
lib/olyx/guardrails/secrets/regexp_finding_source.rb

Overview

Converts every Regexp match into an internal offset-aware finding.

Class Method Summary collapse

Class Method Details

.call(source, category, pattern) ⇒ Object



10
11
12
# File 'lib/olyx/guardrails/secrets/regexp_finding_source.rb', line 10

def call(source, category, pattern)
  source.to_enum(:scan, pattern).map { finding(category, Regexp.last_match) }
end