Skip to content

Instantly share code, notes, and snippets.

@pedrogk
Last active September 25, 2015 23:07
Show Gist options
  • Save pedrogk/4480c0c4cd1ffad131c6 to your computer and use it in GitHub Desktop.
Save pedrogk/4480c0c4cd1ffad131c6 to your computer and use it in GitHub Desktop.
Employee
class Employee: Equatable, Hashable {
var ID: Int
var personalInformation: PersonalInformation
var wage: Double
init(ID: Int, personalInformation: PersonalInformation, wage: Double) {
self.ID = ID
self.personalInformation = personalInformation
self.wage = wage
}
var description: String {
return "My name is \(personalInformation.name), " +
"ID: \(ID), and work at this airline"
}
var hashValue: Int {
get {
return self.ID
}
}
}
func ==(lhs: Employee, rhs: Employee) -> Bool {
return lhs.ID == rhs.ID
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment