module Voom::Presenters::Helpers::Redact

Public Instance Methods

redact(string, last_chars = 4) click to toggle source

material.io/guidelines/patterns/data-formats.html#data-formats-data-redaction-truncation

# File lib/voom/presenters/helpers/redact.rb, line 6
def redact(string, last_chars = 4)
  return "" unless string
  "• • • #{string.split(//).last(last_chars).join}"
end