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

## Description

A polygon defined by a list of Points objects.

### Methods

new to_xml

### Attributes

points | [RW] | Array of Point objects.

### Public Class methods

new()

[Source]

         # File lib/bio/db/phyloxml/phyloxml_elements.rb, line 491
    491:       def initialize
    492:         @points = []
    493:       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 497
    497:       def to_xml
    498:         if @points.length > 2
    499:           pol = LibXML::XML::Node.new('polygon')
    500:           @points.each do |p|
    501:             pol << p.to_xml
    502:           end
    503:           return pol
    504:         end
    505:       end

[Validate]