Last active
December 7, 2017 14:48
-
-
Save nderkach/13cc2e3192f8f48859d7496c1bf2f4cd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fileprivate init() { | |
... | |
let jsonDecoder = JSONDecoder() | |
// –––––– Mapping from specific paths to models –––––– | |
service.configureTransformer("/status") { | |
try jsonDecoder.decode([String: String].self, from: $0.content) | |
} | |
} | |
// MARK: - Resource Accessors | |
func status() -> Resource { | |
return service.resource("/status") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment