mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-05-07 01:41:46 +08:00
Finished split into more logical components. Library now copies Headers to Build/RestKit and you can selectively link against the components your app needs. libRestKit.a contains everything from the core library.
This commit is contained in:
36
Code/ObjectMapping/RKObject.m
Normal file
36
Code/ObjectMapping/RKObject.m
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// 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;
|
||||
}
|
||||
|
||||
+ (NSDictionary*)elementToRelationshipMappings {
|
||||
return [NSDictionary dictionary];
|
||||
}
|
||||
|
||||
+ (id)object {
|
||||
return [[self new] autorelease];
|
||||
}
|
||||
|
||||
- (NSDictionary*)paramsForSerialization {
|
||||
NSMutableDictionary* params = [NSMutableDictionary dictionary];
|
||||
for (NSString* elementName in [[self class] elementToPropertyMappings]) {
|
||||
NSString* propertyName = [[[self class] elementToPropertyMappings] objectForKey:elementName];
|
||||
[params setValue:[self valueForKey:propertyName] forKey:elementName];
|
||||
}
|
||||
|
||||
return [NSDictionary dictionaryWithDictionary:params];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user