Class: GraphML

Inherits:
Object
  • Object
show all
Defined in:
lib/Yinspire/Loaders/GraphML.rb

Defined Under Namespace

Classes: Edge, Graph, Node

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGraphML

Returns a new instance of GraphML.



16
17
18
19
20
# File 'lib/Yinspire/Loaders/GraphML.rb', line 16

def initialize
  @keys = Hash.new
  @graphs = Hash.new
  @ids = Hash.new
end

Instance Attribute Details

#graphsObject (readonly)

Returns the value of attribute graphs.



9
10
11
# File 'lib/Yinspire/Loaders/GraphML.rb', line 9

def graphs
  @graphs
end

Class Method Details

.parse(io) ⇒ Object



11
12
13
14
# File 'lib/Yinspire/Loaders/GraphML.rb', line 11

def self.parse(io)
  doc = REXML::Document.new(io)
  new().parse(doc)
end

Instance Method Details

#parse(doc) ⇒ Object



22
23
24
25
26
# File 'lib/Yinspire/Loaders/GraphML.rb', line 22

def parse(doc)
  parse_keys(doc.root)
  parse_graphs(doc.root)
  return self
end