Sha256: f14dab1941dd5c16c8abe84ff43e58d914e1fd2949400f4ddc895c2b50c06966
Contents?: true
Size: 287 Bytes
Versions: 74
Compression:
Stored size: 287 Bytes
Contents
class String def mask_cc_number masked = '' if self.gsub(/\D+/i, '').match(/^(\d\d)(.+)(\d\d\d\d)$/) masked = $1 + $2.length.times.inject('') { |s, i| "#{s}*" } + $3 end masked end def mask_csv self.length.times.inject('') { |s, i| "#{s}*" } end end
Version data entries
74 entries across 74 versions & 1 rubygems