Class: FAA::Delay::GroundDelay
- Inherits:
-
FAA::Delay
- Object
- FAA::Delay
- FAA::Delay::GroundDelay
- Defined in:
- lib/faa/delay/ground_delay.rb
Instance Attribute Summary collapse
-
#average ⇒ Object
Returns the value of attribute average.
-
#maximum ⇒ Object
Returns the value of attribute maximum.
Attributes inherited from FAA::Delay
Class Method Summary collapse
Instance Attribute Details
#average ⇒ Object
Returns the value of attribute average.
3 4 5 |
# File 'lib/faa/delay/ground_delay.rb', line 3 def average @average end |
#maximum ⇒ Object
Returns the value of attribute maximum.
3 4 5 |
# File 'lib/faa/delay/ground_delay.rb', line 3 def maximum @maximum end |
Class Method Details
.from_xml(root) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/faa/delay/ground_delay.rb', line 5 def self.from_xml(root) delays = [] root.children.each do |node| delay = new node.children.each do |child| case child.name when 'ARPT' delay.airport_id = child.content.strip when 'Reason' delay.reason = child.content.strip when 'Avg' delay.average = child.content when 'Max' delay.maximum = child.content end end delays << delay end delays end |