Skip to content

Instantly share code, notes, and snippets.

@Banck
Last active July 7, 2018 12:11
Show Gist options
  • Save Banck/013171492c1dae6a90932df072798951 to your computer and use it in GitHub Desktop.
Save Banck/013171492c1dae6a90932df072798951 to your computer and use it in GitHub Desktop.
class Transaction: JSONAutoRepresentable {
var amount: String?
var balance: String? //balance after transaction
var createdAt: String?
//sourcery: skip
var place: Places? // where the transaction was made
//sourcery: jsonKey = "partner"
var partnerName: String?
// sourcery:inline:auto:Transaction.JSONAutoRepresentable
init(_ json: JSON) {
amount = json["amount"].string
balance = json["balance"].string
createdAt = json["created_at"].string
partnerName = json["partner"].string
}
// sourcery:end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment