//
 /***************************************************************
 * Copyright © 2017 HERE Global B.V. All rights reserved. *
 **************************************************************/

#import "HereSDKDemandQueryRidesResponse+Dictionary.h"
#import "HereSDKDemandRide+Dictionary.h"
#import "NSDate+NSNumber.h"

@implementation HereSDKDemandQueryRidesResponse (Dictionary)

- (NSDictionary *)dictionary
{
    NSMutableArray *rides = [NSMutableArray new];
    for (HereSDKDemandRide *ride in self.ridesArray)
    {
        [rides addObject:ride.dictionary];
    }

    return @{
             @"fromUpdateTime": (self.fromUpdateTime) ? self.fromUpdateTime.hereSdk_toNumber : [NSNull null],
             @"toUpdateTime": self.toUpdateTime.hereSdk_toNumber,
             @"rides": rides,
             };
}

@end
