Improved the flexibility of the block loaders significantly by allowing them to override the object mapping and routing selection. Made sendObject:method:delegate:block private and introduced public sendObject:delegate:block method instead. Wrote some basic specs for overriding the router.

This commit is contained in:
Blake Watters
2011-07-28 13:54:39 -04:00
parent afc6167554
commit e6e528fcf1
4 changed files with 94 additions and 4 deletions

View File

@@ -33,6 +33,8 @@ NSString* const RKObjectMappingNestingAttributeKeyName = @"<RK_NESTING_ATTRIBUTE
return [self mappingForClass:[NSMutableDictionary class]];
}
#if NS_BLOCKS_AVAILABLE
+ (id)mappingForClass:(Class)objectClass block:(void(^)(RKObjectMapping*))block {
RKObjectMapping* mapping = [self mappingForClass:objectClass];
block(mapping);
@@ -45,6 +47,7 @@ NSString* const RKObjectMappingNestingAttributeKeyName = @"<RK_NESTING_ATTRIBUTE
return mapping;
}
#endif // NS_BLOCKS_AVAILABLE
- (id)init {
self = [super init];