class Bio::PhyloXML::Date
Description¶ ↑
A date associated with a clade/node. Its value can be numerical by using the ‘value’ element and/or free text with the ‘desc’ element’ (e.g. ‘Silurian’). If a numerical value is used, it is recommended to employ the ‘unit’ attribute to indicate the type of the numerical value (e.g. ‘mya’ for ‘million years ago’).
Attributes
desc[RW]
Free text description of the date.
maximum[R]
Integer. Minimum and maximum of the value.
minimum[R]
Integer. Minimum and maximum of the value.
unit[RW]
String. Units in which value is stored.
value[R]
Integer. Value of the date.
Public Instance Methods
maximum=(str)
click to toggle source
# File lib/bio-phyloxml/phyloxml_elements.rb 808 def maximum=(str) 809 @maximum = str.to_i 810 end
minimum=(str)
click to toggle source
# File lib/bio-phyloxml/phyloxml_elements.rb 804 def minimum=(str) 805 @minimum = str.to_i 806 end
to_s()
click to toggle source
Returns value + unit, for exampe “7 mya”
# File lib/bio-phyloxml/phyloxml_elements.rb 817 def to_s 818 return "#{value} #{unit}" 819 end
to_xml()
click to toggle source
Converts elements to xml representation. Called by PhyloXML::Writer
class.
# File lib/bio-phyloxml/phyloxml_elements.rb 822 def to_xml 823 date = LibXML::XML::Node.new('date') 824 PhyloXML::Writer.generate_xml(date, self, [ 825 [:attr, 'unit'], 826 [:simple, 'desc', (defined? @desc) ? @desc : nil], 827 [:simple, 'value', (defined? @value) ? @value : nil], 828 [:simple, 'minimum', (defined? @minimum) ? @minimum : nil], 829 [:simple, 'maximum', (defined? @maximum) ? @maximum : nil]]) 830 return date 831 end
value=(str)
click to toggle source
# File lib/bio-phyloxml/phyloxml_elements.rb 812 def value= (str) 813 @value = str.to_i 814 end