Created
September 17, 2017 23:39
-
-
Save Stoff81/059f5c5b323a7663c3335b7fd2884042 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
class Beer: Drink { | |
var alcohol_content: String | |
private enum CodingKeys: String, CodingKey { | |
case alcohol_content | |
} | |
required init(from decoder: Decoder) throws { | |
let container = try decoder.container(keyedBy: CodingKeys.self) | |
self.alcohol_content = try container.decode(String.self, forKey: .alcohol_content) | |
try super.init(from: decoder) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment