class Bio::PhyloXML::Polygon

Description

A polygon defined by a list of Points objects.

Attributes

points[RW]

Array of Point objects.

Public Class Methods

new() click to toggle source
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 500
def initialize
  @points = []
end

Public Instance Methods

to_xml() click to toggle source

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

# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 506
def to_xml
  if @points.length > 2          
    pol = LibXML::XML::Node.new('polygon')
    @points.each do |p|
      pol << p.to_xml
    end
    return pol
  end
end