The Pipeline will have ONE add, that takes a block/config object:
-(id<AGPipe>) add:(void (^)(AGPipeConfig* config)) config;
The "config object" has some type-safe functions to apply certain config options (internally, stored in a NSDictionary...):
@interface AGPipeConfig : NSObject
-(void)type:(NSString*) type;
-(void)baseURL:(NSURL*) baseURL;
// etc...
@end
The usage of the config object, when creating a pipe would look like this:
AGPipeline* pipeline = .......
id<AGPipe> projectsPipe = [pipeline add:^(AGPipeConfig *config) {
[config name:@"projects"];
[config type:@"REST"];
[config baseURL:[NSURL URLWithString:@"https://todo-aerogear.rhcloud.com/todo-server"]];
}];
// read...
[projectsPipe read:.................];
Thinking about making the AG(Pipe)Config a protocol (on the PUBLIC API)....