-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate Mappable from ImmutableMappable
To each one of them implement one way of `init?(fromFileName file: String)`.
- Loading branch information
Rafael da Silva Ferreira
committed
Mar 30, 2017
1 parent
ea3628e
commit eb27dfb
Showing
4 changed files
with
28 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// Mappable.swift | ||
// Pods | ||
// | ||
// Created by Rafael Ferreira on 3/30/17. | ||
// | ||
// | ||
|
||
import protocol ObjectMapper.Mappable | ||
|
||
extension Mappable { | ||
init?(fromFileName file: String) { | ||
guard let json = file.fileDictionary() else { return nil } | ||
|
||
self.init(JSON: json) | ||
} | ||
|
||
init?(fromStub stub: FileStub) { | ||
self.init(fromFileName: stub.fileName) | ||
} | ||
} |