Module: Alf::Support::DotUtils

Included in:
Algebra::ToDot, Engine::ToDot
Defined in:
lib/alf-support/alf/support/dot_utils.rb

Instance Method Summary collapse

Instance Method Details

#dot_label(label, strip = 100) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/alf-support/alf/support/dot_utils.rb', line 5

def dot_label(label, strip = 100)
  label = label.to_s[0..strip]
               .gsub(/"/, '\"')
               .gsub(/\n/, '\n')
               .gsub(">", ">")
  %Q{"#{label}"}
end