// // Person.m // objective_resource // // Created by David Avendasora // Copyright WO-NoVA 2010. All rights reserved. // #import "Person.h" #import "ObjectiveResourceConfig.h" @implementation Person @synthesize createdAt, updatedAt, firstName, lastName, personId; // plural of person: + (NSString *)getRemoteCollectionName { return @"people"; } - (NSString *) fullName { if (firstName && firstName.length > 0 && lastName && lastName.length > 0) { return [NSString stringWithFormat:@"%@ %@", firstName, lastName]; } else if (firstName && firstName.length > 0) { return firstName; } else if (lastName && lastName.length > 0) { return lastName; } else { return @"Anonymous"; } } - (NSString *) description { return [self fullName]; } - (void) dealloc { [firstName release]; [lastName release]; [createdAt release]; [updatedAt release]; [super dealloc]; } @end