class Riffer::Guardrails::Modification
Records a guardrail transformation event.
Attributes
The guardrail class that transformed data.
The indices of messages that were changed.
The phase when the transformation occurred (:before or :after).
Public Class Methods
Source
# File lib/riffer/guardrails/modification.rb, line 17 def initialize(guardrail:, phase:, message_indices:) @guardrail = guardrail @phase = phase @message_indices = message_indices end
Public Instance Methods
Source
# File lib/riffer/guardrails/modification.rb, line 27 def to_h { guardrail: guardrail.name, phase: phase, message_indices: message_indices } end
Converts the modification to a hash.