Class: GraphML
- Inherits:
-
Object
- Object
- GraphML
- Defined in:
- lib/Yinspire/Loaders/GraphML.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#graphs ⇒ Object
readonly
Returns the value of attribute graphs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ GraphML
constructor
A new instance of GraphML.
- #parse(doc) ⇒ Object
Constructor Details
#initialize ⇒ GraphML
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
#graphs ⇒ Object (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 |