Created
December 25, 2017 16:54
-
-
Save bartjacobs/49f68cd32a96e9dfe60e6a7599ce322e to your computer and use it in GitHub Desktop.
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
import Unbox | |
struct Restaurant: Unboxable { | |
let features: [Feature] | |
init(unboxer: Unboxer) throws { | |
self.features = try unboxer.unbox(key: "features") | |
} | |
} | |
struct Feature: Unboxable { | |
let name: String | |
let address: String | |
init(unboxer: Unboxer) throws { | |
self.name = try unboxer.unbox(keyPath: "attributes.NAME") | |
self.address = try unboxer.unbox(keyPath: "attributes.PHYSICALADDRESS") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment