-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathDCArrayMapping.m
More file actions
44 lines (35 loc) · 1.47 KB
/
Copy pathDCArrayMapping.m
File metadata and controls
44 lines (35 loc) · 1.47 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
41
42
43
44
//
// DCArrayMapping.m
// DCKeyValueObjectMapping
//
// Created by Diego Chohfi on 4/16/12.
// Copyright (c) 2012 dchohfi. All rights reserved.
//
#import "DCArrayMapping.h"
@implementation DCArrayMapping
@synthesize objectMapping = _objectMapping;
@synthesize classForElementsOnArray = _classForElementsOnArray;
+ (DCArrayMapping *) mapperForClassElements: (Class) classForElementsOnArray
forAttribute: (NSString *) attribute
onClass: (Class) classReference{
DCObjectMapping *objectMapping = [DCObjectMapping mapKeyPath:attribute
toAttribute:attribute
onClass:classReference];
return [[self alloc] initWithObjectMapping:objectMapping
forArrayElementOfType:classForElementsOnArray];
}
+ (DCArrayMapping *) mapperForClass: (Class) classForElementsOnArray
onMapping: (DCObjectMapping *) objectMapping {
return [[self alloc] initWithObjectMapping:objectMapping
forArrayElementOfType:classForElementsOnArray];
}
- (id)initWithObjectMapping: (DCObjectMapping *) objectMapping
forArrayElementOfType: (Class) classForElementsOnArray {
self = [super init];
if (self) {
_objectMapping = objectMapping;
_classForElementsOnArray = classForElementsOnArray;
}
return self;
}
@end