Class: String

Inherits:
Object show all
Defined in:
lib/multimap/extras/graphing.rb

Constant Summary collapse

DOT_ESCAPE =
%w( \\ < > { } )
DOT_ESCAPE_REGEXP =
Regexp.compile("(#{Regexp.union(*DOT_ESCAPE).source})")

Instance Method Summary collapse

Instance Method Details

#dot_escapeObject



27
28
29
# File 'lib/multimap/extras/graphing.rb', line 27

def dot_escape
  gsub(DOT_ESCAPE_REGEXP) {|s| "\\#{s}" }
end