Module: Treat::Helpers::String::Unescapable

Defined in:
lib/treat/helpers/string.rb

Overview

Counterpart to Treat::Helpers::Escapable; unescapes floats, restoring the orgiinal text.

Constant Summary collapse

EscapedEscapeChar =

Escaped for regex.

'\^\^\^'
Regex =

Regex for unescape.

/([0-9]+)#{EscapedEscapeChar}([0-9]+)/

Instance Method Summary collapse

Instance Method Details

#unescape_floats!Object

Unescape float periods (restore text).



34
35
36
# File 'lib/treat/helpers/string.rb', line 34

def unescape_floats!
  to_s.gsub!(Regex) { $1 + '.' + $2 }
end