Class: GraphViz::Types::LblString

Inherits:
Common show all
Defined in:
lib/graphviz/types/lbl_string.rb

Instance Method Summary collapse

Methods inherited from Common

#initialize, #source

Constructor Details

This class inherits a constructor from GraphViz::Types::Common

Instance Method Details

#check(data) ⇒ Object



4
5
6
# File 'lib/graphviz/types/lbl_string.rb', line 4

def check(data)
  return data
end

#outputObject Also known as: to_gv, to_s, to_ruby



8
9
10
11
12
13
14
15
# File 'lib/graphviz/types/lbl_string.rb', line 8

def output
  html = /^<([<|(^<)*<].*)>$/m.match(@data.to_s)
  if html != nil
    "<#{html[1]}>"
  else
    @data.to_s.inspect.gsub( "\\\\", "\\" )
  end
end