- Move mapping key from Protected to PNObject

This commit is contained in:
Giuseppe Nucifora 2016-02-16 18:39:18 +01:00
parent 83bec2d75a
commit 9e63928c8b
4 changed files with 14 additions and 16 deletions

View File

@ -8,14 +8,6 @@
#import "PNObject.h" #import "PNObject.h"
#pragma mark MappingSelector Keys
extern NSString* _Nonnull const PNObjectMappingKey;
extern NSString* _Nonnull const PNObjectMappingType;
extern NSString* _Nonnull const PNObjectMappingSelector;
#pragma mark -
@interface PNObject (Protected) @interface PNObject (Protected)
/** /**
* <#Description#> * <#Description#>

View File

@ -11,13 +11,7 @@
#import <NSDate_Utils/NSDate+NSDate_Util.h> #import <NSDate_Utils/NSDate+NSDate_Util.h>
#import "objc/runtime.h" #import "objc/runtime.h"
extern NSString* _Nonnull const PNObjectMappingKey;
extern NSString* _Nonnull const PNObjectMappingType;
extern NSString* _Nonnull const PNObjectMappingSelector;
NSString * const PNObjectMappingKey = @"PNObjectLocalNotificationRefreshTokenClientCredentialSuccess";
NSString * const PNObjectMappingType = @"PNObjectLocalNotificationRefreshTokenClientCredentialFail";
NSString * const PNObjectMappingSelector = @"PNObjectLocalNotificationRefreshTokenClientCredentialFail";
@implementation PNObject (Protected) @implementation PNObject (Protected)
@ -51,8 +45,8 @@ NSString * const PNObjectMappingSelector = @"PNObjectLocalNotificationRefreshTok
id mappingValue = [[[self class] objcetMapping] valueForKey:propertyName]; id mappingValue = [[[self class] objcetMapping] valueForKey:propertyName];
if([mappingValue isKindOfClass:NSDictionary.class]) { if([mappingValue isKindOfClass:NSDictionary.class]) {
mappedJSONKey = [mappingValue valueForKey:@"key"]; mappedJSONKey = [mappingValue valueForKey:PNObjectMappingKey];
mappedJSONType = [mappingValue valueForKey:@"type"]; mappedJSONType = [mappingValue valueForKey:PNObjectMappingType];
} else { } else {
mappedJSONKey = mappingValue; mappedJSONKey = mappingValue;
} }

View File

@ -10,6 +10,14 @@
#import "PNObjectConfig.h" #import "PNObjectConfig.h"
#import "PNObjectModel.h" #import "PNObjectModel.h"
#pragma mark MappingSelector Keys
extern NSString* _Nonnull const PNObjectMappingKey;
extern NSString* _Nonnull const PNObjectMappingType;
extern NSString* _Nonnull const PNObjectMappingSelector;
#pragma mark -
@protocol PNObjectSubclassing <NSObject> @protocol PNObjectSubclassing <NSObject>
@required @required

View File

@ -17,6 +17,10 @@
#define PNOBJECT_DIR @"PNObjects" #define PNOBJECT_DIR @"PNObjects"
NSString * const PNObjectMappingKey = @"key";
NSString * const PNObjectMappingType = @"type";
NSString * const PNObjectMappingSelector = @"selector";
@interface PNObject() <PNObjectPersistency,PNObjectSubclassing> @interface PNObject() <PNObjectPersistency,PNObjectSubclassing>