Class: FAA::Delay::GroundStop

Inherits:
FAA::Delay show all
Defined in:
lib/faa/delay/ground_stop.rb

Instance Attribute Summary collapse

Attributes inherited from FAA::Delay

#airport_id, #reason

Class Method Summary collapse

Instance Attribute Details

#end_timeObject

Returns the value of attribute end_time.



3
4
5
# File 'lib/faa/delay/ground_stop.rb', line 3

def end_time
  @end_time
end

Class Method Details

.from_xml(xml) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/faa/delay/ground_stop.rb', line 5

def self.from_xml(xml)
  delays = []
  
  xml.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 'End_Time'
        delay.end_time = Time.parse(child.content)
      end
    end
    delays << delay
  end
  delays
end