Class: FAA::Delay::AirspaceFlow::Polygon::PointsList

Inherits:
Object
  • Object
show all
Defined in:
lib/faa/delay/airspace_flow/polygon/point_list.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePointsList

Returns a new instance of PointsList.



5
6
7
# File 'lib/faa/delay/airspace_flow/polygon/point_list.rb', line 5

def initialize
  @points = []
end

Instance Attribute Details

#pointsObject

Returns the value of attribute points.



3
4
5
# File 'lib/faa/delay/airspace_flow/polygon/point_list.rb', line 3

def points
  @points
end

Class Method Details

.from_xml(xml) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/faa/delay/airspace_flow/polygon/point_list.rb', line 9

def self.from_xml(xml)
  list = new
  xml.children.each do |child|
    if child.name == "Point"
      list.points << {'latitude' => child.attributes['Lat'].to_f,
                      'longitude' => child.attributes['Long'].to_f}
    end
  end
  list
end