Class: Bio::PhyloXML::Reference
- Defined in:
- lib/bio/db/phyloxml/phyloxml_elements.rb
Overview
Description
A literature reference for a clade. It is recommended to use the ‘doi’ attribute instead of the free text ‘desc’ element whenever possible.
Instance Attribute Summary collapse
-
#desc ⇒ Object
String.
-
#doi ⇒ Object
String.
Instance Method Summary collapse
-
#to_xml ⇒ Object
Converts elements to xml representation.
Instance Attribute Details
#desc ⇒ Object
String. Free text description.
996 997 998 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 996 def desc @desc end |
#doi ⇒ Object
String. Digital Object Identifier.
993 994 995 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 993 def doi @doi end |
Instance Method Details
#to_xml ⇒ Object
Converts elements to xml representation. Called by PhyloXML::Writer class.
999 1000 1001 1002 1003 1004 1005 |
# File 'lib/bio/db/phyloxml/phyloxml_elements.rb', line 999 def to_xml ref = LibXML::XML::Node.new('reference') Writer.generate_xml(ref, self, [ [:attr, 'doi'], [:simple, 'desc', (defined? @desc) ? @desc : nil]]) return ref end |