Class | Bio::PhyloXML::Distribution
In: | lib/bio/db/phyloxml/phyloxml_elements.rb
Parent: | Object

## Description

The geographic distribution of the items of a clade (species, sequences), intended for phylogeographic applications.

### Methods

new to_xml

### Attributes

desc | [RW] | String. Free text description of location.
points | [RW] | Array of Point objects. Holds coordinates of the location.
polygons | [RW] | Array of Polygon objects.

### Public Class methods

new()

[Source]

         # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 414
    414:       def initialize
    415:         @points = []
    416:         @polygons = []
    417:       end

### Public Instance methods

to_xml()

Converts elements to xml representation. Called by PhyloXML::Writer class.

[Source]

         # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 421
    421:       def to_xml
    422:         distr = LibXML::XML::Node.new('distribution')
    423:         PhyloXML::Writer.generate_xml(distr, self, [
    424:             [:simple, 'desc', @desc],
    425:             [:objarr, 'point', 'points'],
    426:             [:objarr, 'polygon', 'polygons']])
    427:         return distr
    428:       end

[Validate]