class Console::Output::Sensitive::Filter
A simple filter for redacting sensitive information.
def call(text)
@parameter text [String] The text to filter.
Apply the filter to the given text. This will replace all occurrences of the pattern with the corresponding substitution.
def call(text) text.gsub(@pattern, @substitutions) end
def initialize(substitutions)
Create a new filter.
def initialize(substitutions) @substitutions = substitutions @pattern = Regexp.union(substitutions.keys) end