Method: Twb::Util::GML#renderEdges

Defined in:
lib/twb/util/gml.rb

#renderEdges(file) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
# File 'lib/twb/util/gml.rb', line 96

def renderEdges file
  edges = Set.new
  @edges.each do |edge|
    gmlSourceID = Digest::MD5.hexdigest(edge.from.id)
    gmlTargetID = Digest::MD5.hexdigest(edge.to.id)
    edges << "edge [\n        source \"#{gmlSourceID}\" \n        target \"#{gmlTargetID}\" \n    ]"
  end
  edges.each do |edge|
    file.puts edge
  end
end