9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/flight_info/fiveonebook_flight.rb', line 9
def self.build_query(args)
cabin_class, direct_flight, adult_num, child_num, depart_airport, arri_airport, depart_time, current_time, return_airport, home_airport, back_time = args.values_at(:cabin_class, :direct_flight, :adult_num, :child_num, :depart_airport, :arri_airport, :depart_time, :current_time, :return_airport, :home_airport, :back_time)
{
agencyCode: Auth.username,
rsIsGzip: true,
timeStamp: current_time,
RQData: {
cabinClass: cabin_class,
directFlight: direct_flight,
routeType: 'RT',
resourceChannel: 1,
passengerNumberVo: [{
passengerType: 'ADT',
passengerNumber: adult_num
}, {
passengerType: 'CHD',
passengerNumber: child_num
}],
segmentList: [{
departureAirport: depart_airport,
arrivalAirport: arri_airport,
departureTime: depart_time
},
{
departureAirport: return_airport,
arrivalAirport: home_airport,
departureTime: back_time
}]
}
}
end
|