Module: NumberHumanizer::StringExtensions

Included in:
String
Defined in:
lib/number_humanizer/monkey_patchers.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/number_humanizer/monkey_patchers.rb', line 9

def blank?
  self.nil? || self.empty?
end

#present?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/number_humanizer/monkey_patchers.rb', line 13

def present?
  !blank?
end

#squish!Object



3
4
5
6
7
# File 'lib/number_humanizer/monkey_patchers.rb', line 3

def squish!
  self.strip!
  self.gsub!(/\s+/, ' ')
  self
end