Method: RGL::MutableGraph::MutableGraphParser#tag_start
- Defined in:
- lib/rgl/graphxml.rb
#tag_start(name, attrs) ⇒ Object
Processes incoming edge and node elements from GraphML in order to populate the graph given to #new.
39 40 41 42 43 44 45 46 |
# File 'lib/rgl/graphxml.rb', line 39 def tag_start(name, attrs) case name when 'edge' @graph.add_edge(attrs['source'], attrs['target']) when 'node' @graph.add_vertex(attrs['id']) end end |