Created
March 17, 2016 21:34
-
-
Save RoyalIcing/a803be11ee5b7ca7e059 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
enum Fruit { | |
case apple, pear, orange, plum | |
} | |
extension Fruit { | |
var cents: Int { | |
return switch self [ | |
.apple: 70, | |
.pear: 85, | |
.orange: 40, | |
.plum: 120 | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment