Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 54 lines (42 sloc) 1.329 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
//
// GBIvarData.m
// appledoc
//
// Created by Tomaz Kragelj on 26.7.10.
// Copyright (C) 2010, Gentle Bytes. All rights reserved.
//

#import "GBIvarData.h"

@implementation GBIvarData

#pragma mark Initialization & disposal

+ (id)ivarDataWithComponents:(NSArray *)components {
return [[[self alloc] initWithDataFromComponents:components] autorelease];
}

- (id)initWithDataFromComponents:(NSArray *)components {
NSParameterAssert(components != nil);
NSParameterAssert([components count] >= 2);
self = [super init];
if (self) {
NSMutableArray *types = [NSMutableArray arrayWithArray:components];
[types removeLastObject];
self.ivarTypes = types;
self.nameOfIvar = [components lastObject];
}
return self;
}

#pragma mark Overriden methods

- (void)mergeDataFromObject:(id)source {
if (!source || source == self) return;
GBLogDebug(@"%@: Merging data from %@...", self, source);
NSParameterAssert([[source nameOfIvar] isEqualToString:self.nameOfIvar]);
NSParameterAssert([[source ivarTypes] isEqualToArray:self.ivarTypes]);
[super mergeDataFromObject:source];
}

- (NSString *)description {
if (self.parentObject)
return [NSString stringWithFormat:@"%@.%@", self.parentObject, self.nameOfIvar];
return self.nameOfIvar;
}

#pragma mark Properties

@synthesize nameOfIvar;
@synthesize ivarTypes;

@end
Something went wrong with that request. Please try again.