Add request descriptor class

This commit is contained in:
Blake Watters
2012-08-24 09:23:19 -04:00
parent 3d5d42bd1f
commit c372a02b29
3 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
//
// RKRequestDescriptor.m
// RestKit
//
// Created by Blake Watters on 8/24/12.
// Copyright (c) 2012 RestKit. All rights reserved.
//
#import "RKRequestDescriptor.h"
@interface RKRequestDescriptor ()
@property (nonatomic, strong, readwrite) RKMapping *mapping;
@property (nonatomic, strong, readwrite) Class objectClass;
@property (nonatomic, copy, readwrite) NSString *rootKeyPath;
@end
@implementation RKRequestDescriptor
+ (id)requestDescriptorWithMapping:(RKMapping *)mapping objectClass:(Class)objectClass rootKeyPath:(NSString *)rootKeyPath
{
RKRequestDescriptor *requestDescriptor = [self new];
requestDescriptor.mapping = mapping;
requestDescriptor.objectClass = objectClass;
requestDescriptor.rootKeyPath = rootKeyPath;
return requestDescriptor;
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@: %p objectClass=%@ rootKeyPath=%@ : %@>",
NSStringFromClass([self class]), self, NSStringFromClass(self.objectClass), self.rootKeyPath, self.mapping];
}
@end