Skip to content

Instantly share code, notes, and snippets.

@suprie
Created March 15, 2017 17:06
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 suprie/f5bbfe498891fadbfea9e7a0f94161ef to your computer and use it in GitHub Desktop.
Save suprie/f5bbfe498891fadbfea9e7a0f94161ef to your computer and use it in GitHub Desktop.
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