Last active
September 25, 2015 23:07
-
-
Save pedrogk/4480c0c4cd1ffad131c6 to your computer and use it in GitHub Desktop.
Employee
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 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