Class: SearchApi::GoogleFlightsResult
- Inherits:
-
GoogleFlightsResultSchema
- Object
- SearchApi::GoogleFlightsResult
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/searchapi/google_flights_result.rb
Instance Method Summary collapse
Instance Method Details
#all_flights ⇒ Object
262 263 264 |
# File 'lib/searchapi/google_flights_result.rb', line 262 def all_flights ( best_flights || [] ) + ( other_flights || [] ) end |
#cheapest ⇒ Object
266 267 268 |
# File 'lib/searchapi/google_flights_result.rb', line 266 def cheapest all_flights.min_by { | f | f.price || Float::INFINITY } end |
#fastest ⇒ Object
270 271 272 |
# File 'lib/searchapi/google_flights_result.rb', line 270 def fastest all_flights.min_by { | f | f.total_duration || Float::INFINITY } end |
#success? ⇒ Boolean
258 259 260 |
# File 'lib/searchapi/google_flights_result.rb', line 258 def success? self.error.nil? end |