Class Bio::PhyloXML::Taxonomy
In: lib/bio/db/phyloxml/phyloxml_elements.rb
Parent: Bio::Taxonomy

Taxonomy class

Methods

new   to_xml  

Attributes

id_source  [RW]  Used to link other elements to a taxonomy (on the xml-level)
other  [RW]  Array of Other objects. Used to save additional information from other than PhyloXML namspace.
taxonomy_id  [RW]  String. Unique identifier of a taxon.
uri  [RW]  Uri object

Public Class methods

[Source]

    # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 86
86:     def initialize
87:       super
88:       @other = []
89:     end

Public Instance methods

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

[Source]

     # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 92
 92:     def to_xml
 93:       taxonomy = LibXML::XML::Node.new('taxonomy')
 94:       taxonomy["type"] = @type if @type != nil
 95:       taxonomy["id_source"] = @id_source if @id_source != nil
 96: 
 97:       PhyloXML::Writer.generate_xml(taxonomy, self, [[:complex, 'id', @taxonomy_id],
 98:         [:pattern, 'code', @code, Regexp.new("^[a-zA-Z0-9_]{2,10}$")],
 99:         [:simple, 'scientific_name', @scientific_name],
100:         [:simple, 'authority', @authority],
101:         [:simplearr, 'common_name', @common_names],
102:         [:simplearr, 'synonym', @synonyms],
103:         [:simple, 'rank', @rank],
104:         [:complex, 'uri',@uri]])
105:         #@todo anything else
106: 
107: 
108:       return taxonomy
109:     end

[Validate]