class Console::Output::Sensitive::Filter

A simple filter for redacting sensitive information.

def call(text)

@returns [String] The filtered 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)

@parameter substitutions [Hash] The substitutions to apply.

Create a new filter.
def initialize(substitutions)
	@substitutions = substitutions
	@pattern = Regexp.union(substitutions.keys)
end