Skip to content

Commit

Permalink
Move isIgnored into its own category
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kim Dung-Pham committed Sep 26, 2018
1 parent 7784c2e commit 38e62d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 5 additions & 1 deletion mogenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
- (NSArray*)entitiesWithACustomSubclassInConfiguration:(NSString*)configuration_ verbose:(BOOL)verbose_;
@end

@interface NSEntityDescription (userInfo)
/// @return Whether or not the entity should be ignored during code generation
- (BOOL)isIgnored;
@end

@interface NSEntityDescription (customBaseClass)
- (BOOL)hasCustomClass;
- (BOOL)hasSuperentity;
Expand All @@ -27,7 +32,6 @@
- (NSString*)additionalHeaderFileName;
- (void)_processPredicate:(NSPredicate*)predicate_ bindings:(NSMutableArray*)bindings_;
- (NSArray*)prettyFetchRequests;
- (BOOL)isIgnored;
@end

@interface NSAttributeDescription (typing)
Expand Down
16 changes: 9 additions & 7 deletions mogenerator.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ - (NSArray*)entitiesWithACustomSubclassInConfiguration:(NSString*)configuration_
}
@end

@implementation NSEntityDescription (userInfo)
- (BOOL)isIgnored {
NSString *readonlyUserinfoValue = [[self userInfo] objectForKey:kIgnored];
if (readonlyUserinfoValue != nil) {
return YES;
}
return NO;
}
@end

@implementation NSEntityDescription (customBaseClass)
- (BOOL)hasCustomBaseCaseImport {
Expand Down Expand Up @@ -420,13 +429,6 @@ - (NSArray*)prettyFetchRequests {
return result;
}

- (BOOL)isIgnored {
NSString *readonlyUserinfoValue = [[self userInfo] objectForKey:kIgnored];
if (readonlyUserinfoValue != nil) {
return YES;
}
return NO;
}
@end

@implementation NSAttributeDescription (typing)
Expand Down

0 comments on commit 38e62d1

Please sign in to comment.