Sha256: 6d345d1d03915c434abab1d59436292880be876ce3e3950f5f54f045764c1688
Contents?: true
Size: 399 Bytes
Versions: 8
Compression:
Stored size: 399 Bytes
Contents
# frozen_string_literal: true class String EXCLUDED_CHARS = %w[" ' . , ! ? ( ) - _ ` ‘ ’ “ ”].freeze EXCLUDED_CHARS_ESC = EXCLUDED_CHARS.map { |c| "\\#{c}" } EXCLUDED_CHARS_RE = /#{EXCLUDED_CHARS_ESC.join('|')}/ # Removes blank padding and double+single quotes def normalize self.upcase.strip end def without_punctuation self.gsub(EXCLUDED_CHARS_RE, '') end end
Version data entries
8 entries across 8 versions & 2 rubygems