module DDQL::StringRefinements

Public Instance Methods

blank?() click to toggle source
# File lib/ddql/string_refinements.rb, line 4
def blank?
  empty? || strip.empty?
end
squish() click to toggle source
# File lib/ddql/string_refinements.rb, line 8
def squish
  self.dup.squish!
end
squish!() click to toggle source
# File lib/ddql/string_refinements.rb, line 12
def squish!
  # this implementation is required (vs. just chaining message calls)
  # because string! and gsub! return `nil` if nothing changes
  strip!
  gsub!(/[[:space:]]+/, ' ')
  self
end