Module: Olyx::Guardrails::Pii::TextScrubber

Defined in:
lib/olyx/guardrails/pii/text_scrubber.rb

Overview

Redacts recognized PII from one String.

Class Method Summary collapse

Class Method Details

.call(text) ⇒ Object



12
13
14
15
16
# File 'lib/olyx/guardrails/pii/text_scrubber.rb', line 12

def call(text)
  return text unless text.is_a?(String)

  PatternCatalog::ENTRIES.reduce(text) { |output, entry| replace(output, entry) }
end