Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/stealth/core_ext/string.rb
Constant Summary collapse
- EXCLUDED_CHARS =
%w[" ' . , ! ? ( ) - _ ` ‘ ’ “ ”].freeze
- EXCLUDED_CHARS_ESC =
EXCLUDED_CHARS.map { |c| "\\#{c}" }
- EXCLUDED_CHARS_RE =
/#{EXCLUDED_CHARS_ESC.join('|')}/
Instance Method Summary collapse
-
#normalize ⇒ Object
Removes blank padding and double+single quotes.
- #without_punctuation ⇒ Object
Instance Method Details
#normalize ⇒ Object
Removes blank padding and double+single quotes
10 11 12 |
# File 'lib/stealth/core_ext/string.rb', line 10 def normalize self.upcase.strip end |
#without_punctuation ⇒ Object
14 15 16 |
# File 'lib/stealth/core_ext/string.rb', line 14 def without_punctuation self.gsub(EXCLUDED_CHARS_RE, '') end |