Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added more verbose debugging description to various model objects.

  • Loading branch information...
commit 26a30b44dacb48ad40c571809fdd4667a159efb0 1 parent 7485be5
@tomaz authored
View
13 Model/GBAdoptedProtocolsProvider.m
@@ -78,6 +78,19 @@ - (NSString *)description {
return [_parent description];
}
+- (NSString *)debugDescription {
+ NSMutableString *result = [NSMutableString string];
+ if ([self.protocols count] > 0) {
+ [result appendString:@"<"];
+ [[self protocolsSortedByName] enumerateObjectsUsingBlock:^(GBProtocolData *protocol, NSUInteger idx, BOOL *stop) {
+ if (idx > 0) [result appendString:@", "];
+ [result appendString:protocol.nameOfProtocol];
+ }];
+ [result appendString:@">"];
+ }
+ return result;
+}
+
#pragma mark Properties
@synthesize protocols = _protocols;
View
4 Model/GBCategoryData.m
@@ -49,6 +49,10 @@ - (NSString *)description {
return self.idOfCategory;
}
+- (NSString *)debugDescription {
+ return [NSString stringWithFormat:@"category %@ %@\n%@", self.idOfCategory, self.adoptedProtocols.debugDescription, self.methods.debugDescription];
+}
+
- (BOOL)isTopLevelObject {
return YES;
}
View
4 Model/GBClassData.m
@@ -57,6 +57,10 @@ - (NSString *)description {
return self.nameOfClass;
}
+- (NSString *)debugDescription {
+ return [NSString stringWithFormat:@"class %@ %@\n%@", self.nameOfClass, self.adoptedProtocols.debugDescription, self.methods.debugDescription];
+}
+
- (BOOL)isTopLevelObject {
return YES;
}
View
11 Model/GBMethodsProvider.m
@@ -173,6 +173,17 @@ - (NSString *)description {
return [_parent description];
}
+- (NSString *)debugDescription {
+ NSMutableString *result = [NSMutableString string];
+ [self.sections enumerateObjectsUsingBlock:^(GBMethodSectionData *section, NSUInteger idx, BOOL *stop) {
+ [result appendFormat:@"- %@\n", section.sectionName];
+ [section.methods enumerateObjectsUsingBlock:^(GBMethodData *method, NSUInteger idx, BOOL *stop) {
+ [result appendFormat:@" - %@\n", method.methodSelector];
+ }];
+ }];
+ return result;
+}
+
#pragma mark Properties
@synthesize methods = _methods;
View
4 Model/GBProtocolData.m
@@ -45,6 +45,10 @@ - (NSString *)description {
return self.nameOfProtocol;
}
+- (NSString *)debugDescription {
+ return [NSString stringWithFormat:@"protocol %@ %@\n%@", self.nameOfProtocol, self.adoptedProtocols.debugDescription, self.methods.debugDescription];
+}
+
- (BOOL)isTopLevelObject {
return YES;
}
Please sign in to comment.
Something went wrong with that request. Please try again.