Skip to content

Commit c40a593

Browse files
Readme update
1 parent 6c0b7d8 commit c40a593

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ class User: Mappable {
2626
required init(){}
2727

2828
// Mappable
29-
func map<N>(mapper: Mapper<N>) {
30-
username <= mapper["username"]
31-
age <= mapper["age"]
32-
weight <= mapper["weight"]
33-
arr <= mapper["arr"]
34-
dict <= mapper["dict"]
35-
friend <= mapper["friend"]
36-
birthday <= (mapper["birthday"], DateTransform<NSDate, Int>())
29+
func map(map: Map) {
30+
username <= map["username"]
31+
age <= map["age"]
32+
weight <= map["weight"]
33+
arr <= map["arr"]
34+
dict <= map["dict"]
35+
friend <= map["friend"]
36+
birthday <= (map["birthday"], DateTransform<NSDate, Int>())
3737
}
3838
}
3939

@@ -43,9 +43,9 @@ struct Temperature: Mappable {
4343

4444
init(){}
4545

46-
mutating func map<N>(mapper: Mapper<N>) {
47-
celcius <= mapper["celcius"]
48-
fahrenheit <= mapper["fahrenheit"]
46+
mutating func map(map: Map) {
47+
celcius <= map["celcius"]
48+
fahrenheit <= map["fahrenheit"]
4949
}
5050
}
5151
```
@@ -78,7 +78,7 @@ Object mapper can map classes composed of the following types:
7878
##Custom Transfoms
7979
ObjectMapper also supports custom Transforms that convert values during the mapping process. To use a transform, simply create a tuple with the mapper["field_name"] and the transform of choice on the right side of the '<=' operator:
8080
```swift
81-
birthday <= (mapper["birthday"], DateTransform<NSDate, Int>())
81+
birthday <= (map["birthday"], DateTransform<NSDate, Int>())
8282
```
8383
The above transform will convert the JSON Int value to an NSDate when reading JSON and will convert the NSDate to an Int when converting objects to JSON.
8484

0 commit comments

Comments
 (0)