Remove Deprecations section and begin unwinding RKURL API's

This commit is contained in:
Blake Watters
2012-08-23 16:05:12 -04:00
parent 51f771efcd
commit 117dae867b
2 changed files with 5 additions and 65 deletions

View File

@@ -120,37 +120,3 @@
- (RKURL *)URLForRelationship:(NSString *)relationshipName ofObject:(id)object method:(RKRequestMethod)method;
@end
@interface RKRouter (Deprecations)
/**
Use `[[router URLForObject:object method:method] resourcePath]` instead.
@bug Deprecated in v0.11.0
*/
- (NSString *)resourcePathForObject:(NSObject *)object method:(RKRequestMethod)method DEPRECATED_ATTRIBUTE;
/**
Use `[router.routeSet addRoute:[RKRoute routeWithClass:objectClass resourcePathPattern:resourcePathPattern method:RKRequestMethodAny]]` instead.
@bug Deprecated in v0.11.0
*/
- (void)routeClass:(Class)objectClass toResourcePathPattern:(NSString*)resourcePathPattern DEPRECATED_ATTRIBUTE;
/**
Use `[router.routeSet addRoute:[RKRoute routeWithClass:objectClass resourcePathPattern:resourcePathPattern method:method]]` instead.
@bug Deprecated in v0.11.0
*/
- (void)routeClass:(Class)objectClass toResourcePathPattern:(NSString*)resourcePathPattern forMethod:(RKRequestMethod)method DEPRECATED_ATTRIBUTE;
/**
Use the following instead:
RKRoute *route = [RKRoute routeWithClass:objectClass resourcePathPattern:resourcePathPattern method:method];
route.shouldEscapeResourcePath = addEscapes;
[router.routeSet addRoute:route];
*/
- (void)routeClass:(Class)objectClass toResourcePathPattern:(NSString*)resourcePathPattern forMethod:(RKRequestMethod)method escapeRoutedPath:(BOOL)addEscapes DEPRECATED_ATTRIBUTE;
@end

View File

@@ -61,24 +61,24 @@
RKRoute *route = [self.routeSet routeForName:routeName];
if (! route) return nil;
if (method) *method = route.method;
return [self.baseURL URLByAppendingResourcePath:[self resourcePathFromRoute:route forObject:object]];
return [RKURL URLWithString:[self pathFromRoute:route forObject:object] relativeToURL:self.baseURL];
}
- (RKURL *)URLForObject:(id)object method:(RKRequestMethod)method
{
RKRoute *route = [self.routeSet routeForObject:object method:method];
if (! route) return nil;
return [self.baseURL URLByAppendingResourcePath:[self resourcePathFromRoute:route forObject:object]];
return [RKURL URLWithString:[self pathFromRoute:route forObject:object] relativeToURL:self.baseURL];
}
- (RKURL *)URLForRelationship:(NSString *)relationshipName ofObject:(id)object method:(RKRequestMethod)method
{
RKRoute *route = [self.routeSet routeForRelationship:relationshipName ofClass:[object class] method:method];
if (! route) return nil;
return [self.baseURL URLByAppendingResourcePath:[self resourcePathFromRoute:route forObject:object]];
if (! route) return nil;
return [RKURL URLWithString:[self pathFromRoute:route forObject:object] relativeToURL:self.baseURL];
}
- (NSString *)resourcePathFromRoute:(RKRoute *)route forObject:(id)object
- (NSString *)pathFromRoute:(RKRoute *)route forObject:(id)object
{
if (! object) return route.resourcePathPattern;
RKPathMatcher *pathMatcher = [RKPathMatcher matcherWithPattern:route.resourcePathPattern];
@@ -86,29 +86,3 @@
}
@end
@implementation RKRouter (Deprecations)
- (NSString *)resourcePathForObject:(NSObject *)object method:(RKRequestMethod)method DEPRECATED_ATTRIBUTE
{
return [[self URLForObject:object method:method] resourcePath];
}
- (void)routeClass:(Class)objectClass toResourcePathPattern:(NSString*)resourcePathPattern DEPRECATED_ATTRIBUTE
{
[self.routeSet addRoute:[RKRoute routeWithClass:objectClass resourcePathPattern:resourcePathPattern method:RKRequestMethodAny]];
}
- (void)routeClass:(Class)objectClass toResourcePathPattern:(NSString*)resourcePathPattern forMethod:(RKRequestMethod)method DEPRECATED_ATTRIBUTE
{
[self.routeSet addRoute:[RKRoute routeWithClass:objectClass resourcePathPattern:resourcePathPattern method:method]];
}
- (void)routeClass:(Class)objectClass toResourcePathPattern:(NSString*)resourcePathPattern forMethod:(RKRequestMethod)method escapeRoutedPath:(BOOL)addEscapes DEPRECATED_ATTRIBUTE
{
RKRoute *route = [RKRoute routeWithClass:objectClass resourcePathPattern:resourcePathPattern method:method];
route.shouldEscapeResourcePath = addEscapes;
[self.routeSet addRoute:route];
}
@end