#import "GHGherkinDialect.h" @interface GHGherkinDialect () @property (nonatomic, strong) NSString * language; @property (nonatomic, strong) NSArray * featureKeywords; @property (nonatomic, strong) NSArray * backgroundKeywords; @property (nonatomic, strong) NSArray * scenarioKeywords; @property (nonatomic, strong) NSArray * scenarioOutlineKeywords; @property (nonatomic, strong) NSArray * examplesKeywords; @property (nonatomic, strong) NSArray * givenStepKeywords; @property (nonatomic, strong) NSArray * whenStepKeywords; @property (nonatomic, strong) NSArray * thenStepKeywords; @property (nonatomic, strong) NSArray * andStepKeywords; @property (nonatomic, strong) NSArray * butStepKeywords; @property (nonatomic, strong) NSArray * stepKeywords; @end @implementation GHGherkinDialect @synthesize language; @synthesize featureKeywords; @synthesize backgroundKeywords; @synthesize scenarioKeywords; @synthesize scenarioOutlineKeywords; @synthesize examplesKeywords; @synthesize givenStepKeywords; @synthesize whenStepKeywords; @synthesize thenStepKeywords; @synthesize andStepKeywords; @synthesize butStepKeywords; @synthesize stepKeywords; - (id)initWithLanguage:(NSString *)theLanguage featureKeywords:(NSArray *)theFeatureKeywords backgroundKeywords:(NSArray *)theBackgroundKeywords scenarioKeywords:(NSArray *)theScenarioKeywords scenarioOutlineKeywords:(NSArray *)theScenarioOutlineKeywords examplesKeywords:(NSArray *)theExamplesKeywords givenStepKeywords:(NSArray *)theGivenStepKeywords whenStepKeywords:(NSArray *)theWhenStepKeywords thenStepKeywords:(NSArray *)theThenStepKeywords andStepKeywords:(NSArray *)theAndStepKeywords butStepKeywords:(NSArray *)theButStepKeywords { if (self = [super init]) { language = theLanguage; featureKeywords = theFeatureKeywords; backgroundKeywords = theBackgroundKeywords; scenarioKeywords = theScenarioKeywords; scenarioOutlineKeywords = theScenarioOutlineKeywords; examplesKeywords = theExamplesKeywords; givenStepKeywords = theGivenStepKeywords; whenStepKeywords = theWhenStepKeywords; thenStepKeywords = theThenStepKeywords; andStepKeywords = theAndStepKeywords; butStepKeywords = theButStepKeywords; stepKeywords = [[[[givenStepKeywords arrayByAddingObjectsFromArray: whenStepKeywords] arrayByAddingObjectsFromArray: thenStepKeywords] arrayByAddingObjectsFromArray: andStepKeywords] arrayByAddingObjectsFromArray: butStepKeywords]; // Distinct using an NSOrderedSet stepKeywords = [[[NSOrderedSet alloc] initWithArray: stepKeywords] array]; } return self; } @end