Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 40 lines (31 sloc) 1.014 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
//
// Created by pete on 5/20/12.
//
// To change the template use AppCode | Preferences | File Templates.
//


#import "FranklyProtocolHelper.h"
#import "JSON.h"


@implementation FranklyProtocolHelper {

}

+ (NSString *)generateErrorResponseWithReason:(NSString *)reason andDetails:(NSString *)details{
NSDictionary *response = [NSDictionary dictionaryWithObjectsAndKeys:
@"ERROR", @"outcome",
reason, @"reason",
details, @"details",
nil];
return [response JSONRepresentation];
}

+ (NSString *)generateSuccessResponseWithoutResults{
    NSDictionary *response = [NSDictionary dictionaryWithObjectsAndKeys:
     @"SUCCESS", @"outcome",
     nil];
     return [response JSONRepresentation];
}

+ (NSString *)generateSuccessResponseWithResults:(NSArray *)results{
NSDictionary *response = [NSDictionary dictionaryWithObjectsAndKeys:
@"SUCCESS", @"outcome",
results, @"results",
nil];
return [response JSONRepresentation];
}

@end
Something went wrong with that request. Please try again.