Skip to content

Instantly share code, notes, and snippets.

@shabib87
Last active February 25, 2017 08:48
Show Gist options
  • Save shabib87/bcbd597e4e0d831f09a55ad9fa2003d8 to your computer and use it in GitHub Desktop.
Save shabib87/bcbd597e4e0d831f09a55ad9fa2003d8 to your computer and use it in GitHub Desktop.
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
}
convenience init(size: OrderSize, spiceRange: SpiceRange) {
self.init(count: 1, size: size, spiceRange: spiceRange)
}
convenience init(spiceRange: SpiceRange) {
self.init(count: 1, size: .medium, spiceRange: spiceRange)
}
}
class Restaurant {
var biriyaniOrder1 = Biriyani(size: .medium, spiceRange: .extraHot)
var biriyaniOrder2 = Biriyani(spiceRange: .extraHot)
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment