Class: Bio::NeXML::Network
Direct Known Subclasses
Constant Summary collapse
Instance Attribute Summary
Attributes inherited from Tree
Instance Method Summary collapse
-
#initialize(id, options = {}, &block) ⇒ Network
constructor
A new instance of Network.
- #to_xml ⇒ Object
Methods inherited from Tree
#<<, #[], #__add_edge__, #__add_node__, #add_edge, #add_node, #add_rootedge, #ancestors, #children, #create_edge, #create_node, #create_rootedge, #descendents, #each_node, #get_edge_by_id, #get_node_by_id, #has_edge?, #has_node?, #include?, #lowest_common_ancestor, #parent, #remove_edge, #remove_node, #roots
Methods included from Mapper
Constructor Details
#initialize(id, options = {}, &block) ⇒ Network
Returns a new instance of Network.
478 479 480 |
# File 'lib/bio/db/nexml/trees.rb', line 478 def initialize( id, = {}, &block ) super end |
Instance Method Details
#to_xml ⇒ Object
482 483 484 485 486 487 488 489 490 491 492 493 494 |
# File 'lib/bio/db/nexml/trees.rb', line 482 def to_xml node = @@writer.create_node( "network", @@writer.attributes( self, :id, :'xsi:type', :label ) ) self.each_node do |n| node << n.to_xml end self.each_edge do |edge| node << edge.to_xml end node end |