mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-06 22:39:42 +08:00
Added Object Mapping block helpers to RKObjectManager and RKObjectMapping. These enable you to perform ad-hoc object mapping very easily. Extended RKObjectRouter to match on superclasses if no specific route is found. This is helpful when using mocked objects with frameworks like Kiwi. fixes #238
This commit is contained in:
@@ -28,6 +28,23 @@ NSString* const RKObjectMappingNestingAttributeKeyName = @"<RK_NESTING_ATTRIBUTE
|
||||
return [mapping autorelease];
|
||||
}
|
||||
|
||||
+ (id)serializationMapping {
|
||||
return [self mappingForClass:[NSMutableDictionary class]];
|
||||
}
|
||||
|
||||
+ (id)mappingForClass:(Class)objectClass block:(void(^)(RKObjectMapping*))block {
|
||||
RKObjectMapping* mapping = [self mappingForClass:objectClass];
|
||||
block(mapping);
|
||||
return mapping;
|
||||
}
|
||||
|
||||
+ (id)serializationMappingWithBlock:(void(^)(RKObjectMapping*))block {
|
||||
RKObjectMapping* mapping = [self serializationMapping];
|
||||
block(mapping);
|
||||
return mapping;
|
||||
}
|
||||
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
|
||||
Reference in New Issue
Block a user