Class | Bio::PhyloXML::Taxonomy |
In: |
lib/bio/db/phyloxml/phyloxml_elements.rb
|
Parent: | Bio::Taxonomy |
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 86 86: def initialize 87: super 88: @other = [] 89: end
Converts elements to xml representation. Called by PhyloXML::Writer class.
# 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