Created
March 15, 2017 17:06
-
-
Save suprie/f5bbfe498891fadbfea9e7a0f94161ef 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
struct Invoice { | |
private var invoiceId = 0 | |
private var date = Date() | |
private var items = [Item]() | |
private var name = "" | |
private var paid = false | |
private var paymentData: Date? | |
func paid() { | |
paid = true | |
paymentDate = Date() | |
} | |
} | |
class Payment { | |
func pay(invoice: Invoice) -> Invoice { | |
// do something with invoice here | |
invoice.paid() | |
return invoice | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment