Module: Olyx::Guardrails::PolicyComponents::RedactionResult

Defined in:
lib/olyx/guardrails/policy/redaction_result.rb

Overview

Presents policy matches and their redacted output.

Class Method Summary collapse

Class Method Details

.call(source, findings, transform) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/olyx/guardrails/policy/redaction_result.rb', line 14

def call(source, findings, transform)
  {
    text: UnmatchedTransformer.call(source, RedactionSpans.call(findings), transform),
    violated: findings.any?,
    findings: FindingPresenter.call(findings)
  }
end