Skip to content

Commit 8b69860

Browse files
Merge pull request tristanhimmelman#1079 from itruf/master
ImmutableMappable init fix
2 parents 19d499c + 73cb592 commit 8b69860

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Sources/Mappable.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public protocol StaticMappable: BaseMappable {
4646
static func objectForMapping(map: Map) -> BaseMappable?
4747
}
4848

49-
public extension BaseMappable {
49+
public extension Mappable {
5050

5151
/// Initializes object from a JSON String
5252
init?(JSONString: String, context: MapContext? = nil) {
@@ -65,12 +65,15 @@ public extension BaseMappable {
6565
return nil
6666
}
6767
}
68-
68+
}
69+
70+
public extension BaseMappable {
71+
6972
/// Returns the JSON Dictionary for the object
7073
func toJSON() -> [String: Any] {
7174
return Mapper().toJSON(self)
7275
}
73-
76+
7477
/// Returns the JSON String for the object
7578
func toJSONString(prettyPrint: Bool = false) -> String? {
7679
return Mapper().toJSONString(self, prettyPrint: prettyPrint)

0 commit comments

Comments
 (0)