BTConfiguration.m 530 B

123456789101112131415161718192021222324
  1. #if __has_include(<Braintree/BraintreeCore.h>)
  2. #import <Braintree/BTConfiguration.h>
  3. #else
  4. #import <BraintreeCore/BTConfiguration.h>
  5. #endif
  6. @implementation BTConfiguration
  7. - (instancetype)init {
  8. @throw [[NSException alloc] initWithName:@"Invalid initializer" reason:@"Use designated initializer" userInfo:nil];
  9. }
  10. - (instancetype)initWithJSON:(BTJSON *)json {
  11. if (self = [super init]) {
  12. _json = json;
  13. }
  14. return self;
  15. }
  16. - (NSString *)environment {
  17. return [self.json[@"environment"] asString];
  18. }
  19. @end