Module: Utilities::Rails::Strings
- Defined in:
- lib/utilities/rails/strings.rb
Overview
Methods that receive or generate a String. All methods are dependant on some Rails provided method.
Class Method Summary collapse
-
.nil_squish_strip(string) ⇒ String?
Strips pre/post fixed space and condenses internal spaces, but returns nil (not empty string) if nothing is left.
Class Method Details
.nil_squish_strip(string) ⇒ String?
Returns strips pre/post fixed space and condenses internal spaces, but returns nil (not empty string) if nothing is left.
7 8 9 10 11 12 13 14 |
# File 'lib/utilities/rails/strings.rb', line 7 def self.nil_squish_strip(string) a = string.dup if !a.nil? a.squish! a = nil if a == '' end a end |