class Bio::PhyloXML::Other

Attributes

attributes[RW]
children[RW]
element_name[RW]
value[RW]

Public Class Methods

new() click to toggle source
     # File lib/bio-phyloxml/phyloxml_elements.rb
1163 def initialize
1164   @children = []
1165   @attributes = Hash.new
1166 end

Public Instance Methods

to_xml() click to toggle source

Converts elements to xml representation. Called by PhyloXML::Writer class.

     # File lib/bio-phyloxml/phyloxml_elements.rb
1169 def to_xml
1170   o = LibXML::XML::Node.new(@element_name)
1171   @attributes.each do |key, value|
1172     o[key] = value
1173   end
1174   o << value if value != nil
1175   children.each do |child_node|
1176     o << child_node.to_xml
1177   end
1178   return o
1179 end