Skip to content

Instantly share code, notes, and snippets.

@shabib87
Last active February 25, 2017 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shabib87/156ef81d3fa6d41481702fbed2248f95 to your computer and use it in GitHub Desktop.
Save shabib87/156ef81d3fa6d41481702fbed2248f95 to your computer and use it in GitHub Desktop.
enum OrderSize {
case small
case medium
case large
}
enum SpiceRange {
case spicy
case hot
case extraHot
}
class Biriyani {
let count: Int
let size: OrderSize
let spiceRange: SpiceRange
init (count: Int, size: OrderSize, spiceRange: SpiceRange) {
self.count = count
self.size = size
self.spiceRange = spiceRange
}
}
class Restaurant {
var biriyani = Biriyani(count: 1, size: .medium, spiceRange: .extraHot)
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment