Skip to content

Instantly share code, notes, and snippets.

@pritchie
Created June 9, 2010 01:06
Show Gist options
  • Save pritchie/430895 to your computer and use it in GitHub Desktop.
Save pritchie/430895 to your computer and use it in GitHub Desktop.
def mask n;n.size<=6?n:n[0,6]+'*'*(n.size>=10?n.size-10:10-n.size)+n[-4,n.size>=10?4:0]end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment