Class: Bio::PhyloXML::Distribution
- Inherits:
-
Object
- Object
- Bio::PhyloXML::Distribution
- Defined in:
- lib/bio-phyloxml/phyloxml_elements.rb
Overview
Description
The geographic distribution of the items of a clade (species, sequences), intended for phylogeographic applications.
Instance Attribute Summary collapse
-
#desc ⇒ Object
String.
-
#points ⇒ Object
Array of Point objects.
-
#polygons ⇒ Object
Array of Polygon objects.
Instance Method Summary collapse
-
#initialize ⇒ Distribution
constructor
A new instance of Distribution.
-
#to_xml ⇒ Object
Converts elements to xml representation.
Constructor Details
#initialize ⇒ Distribution
Returns a new instance of Distribution.
409 410 411 412 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 409 def initialize @points = [] @polygons = [] end |
Instance Attribute Details
#desc ⇒ Object
String. Free text description of location.
403 404 405 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 403 def desc @desc end |
#points ⇒ Object
Array of Point objects. Holds coordinates of the location.
405 406 407 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 405 def points @points end |
#polygons ⇒ Object
Array of Polygon objects.
407 408 409 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 407 def polygons @polygons end |
Instance Method Details
#to_xml ⇒ Object
Converts elements to xml representation. Called by PhyloXML::Writer class.
416 417 418 419 420 421 422 423 |
# File 'lib/bio-phyloxml/phyloxml_elements.rb', line 416 def to_xml distr = LibXML::XML::Node.new('distribution') PhyloXML::Writer.generate_xml(distr, self, [ [:simple, 'desc', @desc], [:objarr, 'point', 'points'], [:objarr, 'polygon', 'polygons']]) return distr end |