mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-02 09:31:32 +08:00
* Introduce RKObjectMappable#relationshipsToSerialize to define nested relationships to post * New helper methods for working with relationship serializations. * Extended Rails router to serialize nested objects according to Rails idioms
39 lines
703 B
Objective-C
39 lines
703 B
Objective-C
//
|
|
// RKObject.m
|
|
// RestKit
|
|
//
|
|
// Created by Blake Watters on 7/20/10.
|
|
// Copyright 2010 Two Toasters. All rights reserved.
|
|
//
|
|
|
|
#import "RKObject.h"
|
|
|
|
@implementation RKObject
|
|
|
|
+ (NSDictionary*)elementToPropertyMappings {
|
|
[self doesNotRecognizeSelector:_cmd];
|
|
return nil;
|
|
}
|
|
|
|
+ (NSArray*)relationshipsToSerialize {
|
|
return [NSArray array];
|
|
}
|
|
|
|
+ (NSDictionary*)elementToRelationshipMappings {
|
|
return [NSDictionary dictionary];
|
|
}
|
|
|
|
+ (id)object {
|
|
return [[self new] autorelease];
|
|
}
|
|
|
|
- (NSDictionary*)propertiesForSerialization {
|
|
return RKObjectMappableGetPropertiesByElement(self);
|
|
}
|
|
|
|
- (NSDictionary*)relationshipsForSerialization {
|
|
return RKObjectMappableGetRelationshipsByElement(self);
|
|
}
|
|
|
|
@end
|