Touch up docs for batched object request operations

This commit is contained in:
Blake Watters
2012-09-30 19:29:51 -04:00
parent 8c34f0996b
commit 2280674f5a
5 changed files with 72 additions and 51 deletions

View File

@@ -517,17 +517,18 @@ static BOOL RKDoesArrayOfResponseDescriptorsContainEntityMapping(NSArray *respon
- (void)enqueueBatchOfObjectRequestOperationsWithRoute:(RKRoute *)route
objects:(NSArray *)objects
progress:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progress
progress:(void (^)(NSUInteger numberOfFinishedOperations,
NSUInteger totalNumberOfOperations))progress
completion:(void (^)(NSArray *operations))completion {
NSMutableArray *operations = [[NSMutableArray alloc] initWithCapacity:objects.count];
for (id object in objects) {
RKObjectRequestOperation *operation = nil;
NSURL *URL = [self.router URLForRoute:route object:object];
NSURL *URL = [self.router URLWithRoute:route object:object];
NSAssert(URL, @"Failed to generate URL for route %@ with object %@", route, object);
if ([route isClassRoute]) {
operation = [self appropriateObjectRequestOperationWithObject:object method:RKRequestMethodGET path:[URL relativeString] parameters:nil];
operation = [self appropriateObjectRequestOperationWithObject:object method:route.method path:[URL relativeString] parameters:nil];
} else {
operation = [self appropriateObjectRequestOperationWithObject:nil method:RKRequestMethodGET path:[URL relativeString] parameters:nil];
operation = [self appropriateObjectRequestOperationWithObject:nil method:route.method path:[URL relativeString] parameters:nil];
}
[operations addObject:operation];
}