Class: DecodeFlightRouteResults
- Inherits:
-
Object
- Object
- DecodeFlightRouteResults
- Defined in:
- lib/FlightXML2REST.rb
Instance Attribute Summary collapse
-
#decodeFlightRouteResult ⇒ Object
Returns the value of attribute decodeFlightRouteResult.
Instance Method Summary collapse
-
#initialize(decodeFlightRouteResult = nil) ⇒ DecodeFlightRouteResults
constructor
A new instance of DecodeFlightRouteResults.
Constructor Details
#initialize(decodeFlightRouteResult = nil) ⇒ DecodeFlightRouteResults
Returns a new instance of DecodeFlightRouteResults.
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 |
# File 'lib/FlightXML2REST.rb', line 624 def initialize(decodeFlightRouteResult = nil) begin rawDecodeFlightRouteResult = JSON.parse(decodeFlightRouteResult) decodeFlightRouteResult= rawDecodeFlightRouteResult['DecodeFlightRouteResult'] @decodeFlightRouteResult = ArrayOfFlightRouteStruct.new([],decodeFlightRouteResult['next_offset']) decodeFlightRouteResult['data'].each do |data| @decodeFlightRouteResult.data << FlightRouteStruct.new(data['latitude'], data['longitude'], data['name'], data['type'] ) end rescue raise FlightAwareError.new(rawDecodeFlightRouteResult['error']).error end end |
Instance Attribute Details
#decodeFlightRouteResult ⇒ Object
Returns the value of attribute decodeFlightRouteResult.
623 624 625 |
# File 'lib/FlightXML2REST.rb', line 623 def decodeFlightRouteResult @decodeFlightRouteResult end |