class ConfidentialInfoRedactor::Hyperlink

Constants

Rubular: rubular.com/r/fXa4lp0gfS

Public Instance Methods

replace(text) click to toggle source
# File lib/confidential_info_redactor/hyperlink.rb, line 14
def replace(text)
  text.split(/\s+/).map { |token| text = text.gsub(/#{Regexp.escape(token.gsub(/\.\z/, ''))}/, ' <redacted> ') if !(token !~ HYPERLINK_REGEX) }
  text
end