Class: Bio::PhyloXML::Reference
- Inherits:
-
Object
- Object
- Bio::PhyloXML::Reference
- Defined in:
- lib/bio/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.
975 976 977 |
# File 'lib/bio/phyloxml/elements.rb', line 975 def desc @desc end |
#doi ⇒ Object
String. Digital Object Identifier.
972 973 974 |
# File 'lib/bio/phyloxml/elements.rb', line 972 def doi @doi end |
Instance Method Details
#to_xml ⇒ Object
Converts elements to xml representation. Called by PhyloXML::Writer class.
978 979 980 981 982 983 984 |
# File 'lib/bio/phyloxml/elements.rb', line 978 def to_xml ref = LibXML::XML::Node.new('reference') Writer.generate_xml(ref, self, [ [:attr, 'doi'], [:simple, 'desc', @desc]]) return ref end |