Class: FAA::Airport::Closure
- Inherits:
-
Object
- Object
- FAA::Airport::Closure
- Defined in:
- lib/faa/airport/closure.rb
Instance Attribute Summary collapse
-
#airport_id ⇒ Object
Returns the value of attribute airport_id.
-
#reason ⇒ Object
Returns the value of attribute reason.
-
#reopen ⇒ Object
Returns the value of attribute reopen.
-
#start ⇒ Object
Returns the value of attribute start.
Class Method Summary collapse
Instance Attribute Details
#airport_id ⇒ Object
Returns the value of attribute airport_id.
3 4 5 |
# File 'lib/faa/airport/closure.rb', line 3 def airport_id @airport_id end |
#reason ⇒ Object
Returns the value of attribute reason.
3 4 5 |
# File 'lib/faa/airport/closure.rb', line 3 def reason @reason end |
#reopen ⇒ Object
Returns the value of attribute reopen.
3 4 5 |
# File 'lib/faa/airport/closure.rb', line 3 def reopen @reopen end |
#start ⇒ Object
Returns the value of attribute start.
3 4 5 |
# File 'lib/faa/airport/closure.rb', line 3 def start @start end |
Class Method Details
.from_xml(root) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/faa/airport/closure.rb', line 6 def self.from_xml(root) closures = [] 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 'Start' delay.start = child.content.strip when 'Reopen' delay.reopen = child.content.strip end end closures << delay end closures end |