Skip to content

Commit

Permalink
Merge pull request #268 from danielctull-forks/documentation
Browse files Browse the repository at this point in the history
[NEW] Generate documentation in machine.h files from entity, attribute, relationship, and fetched properties from  `documentation` and `discussion` userinfo keys. (Daniel Tull)
  • Loading branch information
rentzsch committed Feb 14, 2015
2 parents 448e833 + ba69a61 commit 5983bf0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions templates/machine.h.motemplate
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,27 @@ extern const struct <$managedObjectClassName$>UserInfo {<$foreach UserInfo userI
@interface <$managedObjectClassName$>ID : <$if hasSuperentity$><$customSuperentity$>ID<$else$>NSManagedObjectID<$endif$> {}
@end

<$if userInfo.documentation$>
/**
* <$userInfo.documentation$>
*
* <$userInfo.discussion$>
*/
<$endif$>
@interface _<$managedObjectClassName$> : <$customSuperentity$> {}
+ (id)insertInManagedObjectContext:(NSManagedObjectContext*)moc_;
+ (NSString*)entityName;
+ (NSEntityDescription*)entityInManagedObjectContext:(NSManagedObjectContext*)moc_;
@property (nonatomic, readonly, strong) <$managedObjectClassName$>ID* objectID;

<$foreach Attribute noninheritedAttributes do$>
<$if Attribute.userInfo.documentation$>
/**
* <$Attribute.userInfo.documentation$>
*
* <$Attribute.userInfo.discussion$>
*/
<$endif$>
<$if Attribute.hasDefinedAttributeType$>
<$if TemplateVar.arc$>
<$if Attribute.isReadonly$>
Expand Down Expand Up @@ -80,6 +94,13 @@ extern const struct <$managedObjectClassName$>UserInfo {<$foreach UserInfo userI
<$endif$>
<$endforeach do$>
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.userInfo.documentation$>
/**
* <$Relationship.userInfo.documentation$>
*
* <$Relationship.userInfo.discussion$>
*/
<$endif$>
<$if Relationship.isToMany$>
<$if TemplateVar.arc$>
@property (nonatomic, strong) <$Relationship.immutableCollectionClassName$> *<$Relationship.name$>;
Expand All @@ -106,6 +127,13 @@ extern const struct <$managedObjectClassName$>UserInfo {<$foreach UserInfo userI
<$endif$>
<$endforeach do$>
<$foreach FetchedProperty noninheritedFetchedProperties do$>
<$if FetchedProperty.userInfo.documentation$>
/**
* <$FetchedProperty.userInfo.documentation$>
*
* <$FetchedProperty.userInfo.discussion$>
*/
<$endif$>
@property (nonatomic, readonly) NSArray *<$FetchedProperty.name$>;
<$endforeach do$>
<$if TemplateVar.frc$>
Expand Down

0 comments on commit 5983bf0

Please sign in to comment.