Source

BSSAXTweetParserDemo / BSTweet.m

//
//  BSTweet.m
//  BSSAXTweetParserDemo
//
//  Created by Brent Simmons on 6/3/10.
//  Copyright 2010 NewsGator Technologies, Inc. All rights reserved.
//

#import "BSTweet.h"
#import "BSUser.h"


@implementation BSTweet

@synthesize createdAt;
@synthesize statusID;
@synthesize text;
@synthesize source;
@synthesize inReplyToStatusID;
@synthesize inReplyToUserID;
@synthesize inReplyToScreenName;
@synthesize user;


- (id)init {
	self = [super init];
	if (self != nil)
		user = [[BSUser alloc] init];
	return self;
}


- (void)dealloc {
	[createdAt release];
	[statusID release];
	[text release];
	[source release];
	[inReplyToStatusID release];
	[inReplyToUserID release];
	[inReplyToScreenName release];
	[user release];
	[super dealloc];
}


- (NSDictionary *)dictionaryRepresentationForDebuggingOnly {
	NSMutableDictionary *d = [NSMutableDictionary dictionary];
	[d setObject:self.createdAt ? self.createdAt : @"" forKey:@"createdAt"];
	[d setObject:self.statusID ? self.statusID : @"" forKey:@"statusID"];
	[d setObject:self.text ? self.text : @"" forKey:@"text"];
	[d setObject:self.source ? self.source : @"" forKey:@"source"];
	[d setObject:self.inReplyToStatusID ? self.inReplyToStatusID : @"" forKey:@"inReplyToStatusID"];
	[d setObject:self.inReplyToUserID ? self.inReplyToUserID : @"" forKey:@"inReplyToUserID"];
	[d setObject:self.inReplyToScreenName ? self.inReplyToScreenName : @"" forKey:@"inReplyToScreenName"];
	NSDictionary *userDictionary = [self.user dictionaryRepresentationForDebuggingOnly];
	[d setObject:userDictionary ? userDictionary : [NSDictionary dictionary] forKey:@"user"];
	return d;
}


@end