Add this line to your application's Gemfile:
gem 'sensitive_text_filter', :github => 'gkobluk/sensitive_text_filter'And then execute:
$ bundleNeed a new language filter? Here's a quick usage example:
phone = SensitiveTextFilter::Filter.new matchlist: :phone, replacement: :phone
# returns true if any content matched the filter's matchlist, else false
phone.match?('Call us: 0880-333-2333 content.')
=> true
# returns a "cleaned up" version of the text, based on the replacement rule
phone.sanitize('Call us: 0880-333-2333 content.')
=> "'Call us: [hidden phone] content."
same for :address and :email