Class: ZipcodeInfoResults

Inherits:
Object
  • Object
show all
Defined in:
lib/FlightXML2REST.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(zipcodeInfoResult = nil) ⇒ ZipcodeInfoResults

Returns a new instance of ZipcodeInfoResults.



2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
# File 'lib/FlightXML2REST.rb', line 2617

def initialize(zipcodeInfoResult = nil)
  begin
    rawZipcodeInfoResult = JSON.parse(zipcodeInfoResult)
    zipcodeInfoResult = rawZipcodeInfoResult['ZipcodeInfoResult']
    @zipcodeInfoResult = ZipcodeInfoStruct.new(zipcodeInfoResult['city'],
                                               zipcodeInfoResult['county'],
                                               zipcodeInfoResult['latitude'],
                                               zipcodeInfoResult['longitude'],
                                               zipcodeInfoResult['state']    
                                              )
  rescue
      raise FlightAwareError.new(rawZipcodeInfoResult['error']).error
  end
end

Instance Attribute Details

#zipcodeInfoResultObject

Returns the value of attribute zipcodeInfoResult.



2616
2617
2618
# File 'lib/FlightXML2REST.rb', line 2616

def zipcodeInfoResult
  @zipcodeInfoResult
end