Class: Vatbook::Booking
- Inherits:
-
Object
- Object
- Vatbook::Booking
- Defined in:
- lib/vatbook/booking.rb
Instance Attribute Summary collapse
-
#aircraft ⇒ Object
Returns the value of attribute aircraft.
-
#arr ⇒ Object
Returns the value of attribute arr.
-
#callsign ⇒ Object
Returns the value of attribute callsign.
-
#cid ⇒ Object
Returns the value of attribute cid.
-
#dep ⇒ Object
Returns the value of attribute dep.
-
#end ⇒ Object
Returns the value of attribute end.
-
#enroute ⇒ Object
Returns the value of attribute enroute.
-
#fir ⇒ Object
Returns the value of attribute fir.
-
#name ⇒ Object
Returns the value of attribute name.
-
#role ⇒ Object
Returns the value of attribute role.
-
#route ⇒ Object
Returns the value of attribute route.
-
#start ⇒ Object
Returns the value of attribute start.
Instance Method Summary collapse
-
#initialize(booking, role, fir) ⇒ Booking
constructor
A new instance of Booking.
Constructor Details
#initialize(booking, role, fir) ⇒ Booking
Returns a new instance of Booking.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/vatbook/booking.rb', line 9 def initialize(booking, role, fir) @fir = fir @role = role @callsign = booking.children.css("callsign").first.children.to_s @name = booking.children.css("name").first.children.to_s @role == "atc" ? @cid = booking.children.css("cid").first.children.to_s : @cid = booking.children.css("pid").first.children.to_s if @role == "atc" @start = booking.children.css("time_start").first.children.to_s @end = booking.children.css("time_end").first.children.to_s elsif @role == "pilot" @dep = booking.children.css("dep").first.children.to_s @arr = booking.children.css("arr").first.children.to_s @route = booking.children.css("route").first.children.to_s.gsub(/[\n]/, ' ').strip @start = booking.children.css("from").first.children.to_s @end = booking.children.css("to").first.children.to_s @aircraft = booking.children.css("actype").first.children.to_s check_enroute end end |
Instance Attribute Details
#aircraft ⇒ Object
Returns the value of attribute aircraft.
7 8 9 |
# File 'lib/vatbook/booking.rb', line 7 def aircraft @aircraft end |
#arr ⇒ Object
Returns the value of attribute arr.
6 7 8 |
# File 'lib/vatbook/booking.rb', line 6 def arr @arr end |
#callsign ⇒ Object
Returns the value of attribute callsign.
6 7 8 |
# File 'lib/vatbook/booking.rb', line 6 def callsign @callsign end |
#cid ⇒ Object
Returns the value of attribute cid.
6 7 8 |
# File 'lib/vatbook/booking.rb', line 6 def cid @cid end |
#dep ⇒ Object
Returns the value of attribute dep.
6 7 8 |
# File 'lib/vatbook/booking.rb', line 6 def dep @dep end |
#end ⇒ Object
Returns the value of attribute end.
6 7 8 |
# File 'lib/vatbook/booking.rb', line 6 def end @end end |
#enroute ⇒ Object
Returns the value of attribute enroute.
7 8 9 |
# File 'lib/vatbook/booking.rb', line 7 def enroute @enroute end |
#fir ⇒ Object
Returns the value of attribute fir.
7 8 9 |
# File 'lib/vatbook/booking.rb', line 7 def fir @fir end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/vatbook/booking.rb', line 6 def name @name end |
#role ⇒ Object
Returns the value of attribute role.
6 7 8 |
# File 'lib/vatbook/booking.rb', line 6 def role @role end |
#route ⇒ Object
Returns the value of attribute route.
7 8 9 |
# File 'lib/vatbook/booking.rb', line 7 def route @route end |
#start ⇒ Object
Returns the value of attribute start.
6 7 8 |
# File 'lib/vatbook/booking.rb', line 6 def start @start end |