-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
respect property types on current class that is being mapped. This be…
…haviour is turned off by default.
- Loading branch information
1 parent
597c3a9
commit 9bec955
Showing
10 changed files
with
148 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
EasyMappingExample/Tests/Fixtures/FixtureClasses/MutableFoundationClass.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// MutableFoundationClass.h | ||
// EasyMappingExample | ||
// | ||
// Created by Denys Telezhkin on 06.06.15. | ||
// Copyright (c) 2015 EasyKit. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "EKObjectModel.h" | ||
|
||
@interface MutableFoundationClass : EKObjectModel | ||
|
||
@property (nonatomic, strong) NSMutableArray * array; | ||
@property (nonatomic, strong) NSMutableDictionary * dictionary; | ||
@property (nonatomic, strong) NSSet * set; | ||
@property (nonatomic, strong) NSMutableSet * mutableSet; | ||
@property (nonatomic, strong) NSOrderedSet * orderedSet; | ||
@property (nonatomic, strong) NSMutableOrderedSet * mutableOrderedSet; | ||
@end |
25 changes: 25 additions & 0 deletions
25
EasyMappingExample/Tests/Fixtures/FixtureClasses/MutableFoundationClass.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// MutableFoundationClass.m | ||
// EasyMappingExample | ||
// | ||
// Created by Denys Telezhkin on 06.06.15. | ||
// Copyright (c) 2015 EasyKit. All rights reserved. | ||
// | ||
|
||
#import "MutableFoundationClass.h" | ||
|
||
@implementation MutableFoundationClass | ||
|
||
+(EKObjectMapping *)objectMapping | ||
{ | ||
EKObjectMapping * mapping = [[EKObjectMapping alloc] initWithObjectClass:self]; | ||
|
||
[mapping mapPropertiesFromArray:@[@"array",@"dictionary", @"set"]]; | ||
[mapping mapKeyPath:@"ordered_set" toProperty:@"orderedSet"]; | ||
[mapping mapKeyPath:@"mutable_set" toProperty:@"mutableSet"]; | ||
[mapping mapKeyPath:@"mutable_ordered_set" toProperty:@"mutableOrderedSet"]; | ||
mapping.respectPropertyFoundationTypes = YES; | ||
return mapping; | ||
} | ||
|
||
@end |
10 changes: 10 additions & 0 deletions
10
EasyMappingExample/Tests/Fixtures/MutableFoundationClass.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"array":[], | ||
"dictionary": { | ||
"foo":"bar" | ||
}, | ||
"set":[1,2,3], | ||
"mutable_set":["1"], | ||
"ordered_set":["4","5"], | ||
"mutable_ordered_set": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters