Class: TypedForm::Util

Inherits:
Object
  • Object
show all
Defined in:
lib/typed_form/util.rb

Overview

General utility functions used in multiple areas in the gem.

Class Method Summary collapse

Class Method Details

.normalize_spaces(text) ⇒ Object

Removes non-breaking spaces (character point 160) from TypeForm data before beginning processing.



6
7
8
# File 'lib/typed_form/util.rb', line 6

def self.normalize_spaces(text)
  text.gsub(/(\\u00a0|\\xC2\\xA0)/, " ").gsub(/[[:space:]]/, " ")
end