Class: Olyx::Guardrails::Redactor
- Inherits:
-
Object
- Object
- Olyx::Guardrails::Redactor
- Defined in:
- lib/olyx/guardrails/redactor.rb
Overview
Applies the PII, secret, and restricted-policy transformation used by Olyx::Guardrails.redact.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(input, policy) ⇒ Redactor
constructor
A new instance of Redactor.
Constructor Details
#initialize(input, policy) ⇒ Redactor
Returns a new instance of Redactor.
17 18 19 20 |
# File 'lib/olyx/guardrails/redactor.rb', line 17 def initialize(input, policy) @source = input.to_s @policy = policy end |
Class Method Details
.call(input, policy:) ⇒ Object
13 14 15 |
# File 'lib/olyx/guardrails/redactor.rb', line 13 def self.call(input, policy:) new(input, policy).call end |
Instance Method Details
#call ⇒ Object
22 23 24 25 26 |
# File 'lib/olyx/guardrails/redactor.rb', line 22 def call Redaction::InputValidator.call(@source, @policy) content = PolicyAwareRedactor.call(@source, policy: @policy) Redaction::PublicResult.call(@source, content, @policy) end |