Permalink
Browse files

Fixed GBStoreProviding return values for categoryByName: and protocol…

…ByName: and renamed GBCategoryData's categoryID to idOfCategory.

The first is a typical copy/paste "typo" while the second was renamed solely to make it similar in name to the rest of the methods and properties.
  • Loading branch information...
1 parent 1c9a1dc commit 528114072c440bb2e2b0318fd426550f8233b40c @tomaz committed Sep 10, 2010
Showing with 9 additions and 9 deletions.
  1. +1 −1 Model/GBCategoryData.h
  2. +2 −2 Model/GBCategoryData.m
  3. +2 −2 Model/GBStore.m
  4. +2 −2 Model/GBStoreProviding.h
  5. +2 −2 Testing/GBCategoryDataTesting.m
View
2 Model/GBCategoryData.h
@@ -60,7 +60,7 @@
@property (readonly) NSString *nameOfClass;
/** The ID of the category composed of class name followed by category name in parenthesis. */
-@property (readonly) NSString *categoryID;
+@property (readonly) NSString *idOfCategory;
/** Categories adopted protocols, available via `GBAdoptedProtocolsProvider`. */
@property (readonly) GBAdoptedProtocolsProvider *adoptedProtocols;
View
4 Model/GBCategoryData.m
@@ -46,7 +46,7 @@ - (void)mergeDataFromObject:(id)source {
}
- (NSString *)description {
- return self.categoryID;
+ return self.idOfCategory;
}
#pragma mark Properties
@@ -55,7 +55,7 @@ - (BOOL)isExtension {
return ([self nameOfCategory] == nil);
}
-- (NSString *)categoryID {
+- (NSString *)idOfCategory {
if (self.isExtension) return [NSString stringWithFormat:@"%@()", self.nameOfClass];
return [NSString stringWithFormat:@"%@(%@)", self.nameOfClass, self.nameOfCategory];
}
View
4 Model/GBStore.m
@@ -97,11 +97,11 @@ - (GBClassData *)classByName:(NSString *)name {
return [_classesByName objectForKey:name];
}
-- (GBClassData *)categoryByName:(NSString *)name {
+- (GBCategoryData *)categoryByName:(NSString *)name {
return [_categoriesByName objectForKey:name];
}
-- (GBClassData *)protocolByName:(NSString *)name {
+- (GBProtocolData *)protocolByName:(NSString *)name {
return [_protocolsByName objectForKey:name];
}
View
4 Model/GBStoreProviding.h
@@ -93,7 +93,7 @@
@see protocolByName:
@see categories
*/
-- (GBClassData *)categoryByName:(NSString *)name;
+- (GBCategoryData *)categoryByName:(NSString *)name;
/** Returns the protocol instance that matches the given name.
@@ -105,7 +105,7 @@
@see categoryByName:
@see protocols
*/
-- (GBClassData *)protocolByName:(NSString *)name;
+- (GBProtocolData *)protocolByName:(NSString *)name;
/** The list of all registered classes as instances of `GBClassData`.
View
4 Testing/GBCategoryDataTesting.m
@@ -20,8 +20,8 @@ - (void)testCategoryID_shouldReturnProperValue {
GBCategoryData *category = [GBCategoryData categoryDataWithName:@"Category" className:@"Class"];
GBCategoryData *extension = [GBCategoryData categoryDataWithName:nil className:@"Class"];
// execute & verify
- assertThat(category.categoryID, is(@"Class(Category)"));
- assertThat(extension.categoryID, is(@"Class()"));
+ assertThat(category.idOfCategory, is(@"Class(Category)"));
+ assertThat(extension.idOfCategory, is(@"Class()"));
}
#pragma mark Base data merging

0 comments on commit 5281140

Please sign in to comment.