PageRenderTime 32ms CodeModel.GetById 19ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/FSKit/Source/iPhone/Common/FSKPedigreeRequest.m

http://fskit.googlecode.com/
Objective C | 41 lines | 28 code | 6 blank | 7 comment | 0 complexity | 20a065170b480e495e623a8e7b8f24f9 MD5 | raw file
Possible License(s): BSD-3-Clause
 1//
 2//  FSKPedigreeRequest.m
 3//  FSKit
 4//
 5//  Created by Logan Allred on 3/3/09.
 6//  Copyright 2009 RedBugz Software. All rights reserved.
 7//
 8
 9#import "FSKPedigreeRequest.h"
10#import "FSKPedigreeResponse.h"
11
12@implementation FSKPedigreeRequest
13
14+ (void)fetchPedigreeForId:(NSString *)personId
15				 ancestors:(int)ancestors
16			   descendants:(int)descendants
17				connection:aFamilySearchConnection 
18				  delegate:(id)aDelegate 
19				  selector:(SEL)aSelector
20{
21	FSKPedigreeRequest *request = [[FSKPedigreeRequest alloc] initWithFamilySearchConnection:aFamilySearchConnection delegate:aDelegate selector:aSelector];
22	[request sendPedigreeRequestWithId:personId ancestors:ancestors descendants:descendants];
23}
24
25- (void)sendPedigreeRequestWithId:(NSString *)personId
26						ancestors:(int)ancestors
27					  descendants:(int)descendants
28{
29	[self fetchFamilySearchDataAtEndpoint:@"familytree/v2/pedigree" WithIds:[NSSet setWithObject:personId] 
30							   parameters:[NSDictionary dictionaryWithObjectsAndKeys:[[NSNumber numberWithInt:ancestors] stringValue], @"ancestors", [[NSNumber numberWithInt:descendants] stringValue], @"descendants", nil]];
31}
32
33- (FSKPedigreeResponse *)responseWithData:(NSData *)data
34{
35	NSLog(@"%s", __PRETTY_FUNCTION__);	
36	FSKPedigreeResponse *response = [[FSKPedigreeResponse alloc] initWithData:data];
37	NSLog(@"response code: %d message: %@", [response statusCode], [response statusMessage]);	
38	return [response autorelease];
39}
40
41@end