Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created April 23, 2019 10:40
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 fitomad/da8b4177bc9b8760eb2b2dec218f1594 to your computer and use it in GitHub Desktop.
Save fitomad/da8b4177bc9b8760eb2b2dec218f1594 to your computer and use it in GitHub Desktop.
public struct Memento
{
/// Stock disponible de iPhone
public let iPhoneStock: Int
/// Stock disponible de iPad
public let iPadStock: Int
/// Stock disponible de la familia Mac
public let macStock: Int
/// Stock disponible de Apple TV
public let tvStock: Int
/// Momento en el que se crea el *snapshot* de la tienda
private let createdAt: Date
/**
Crea un *snapshot* con las existencias de la tienda
*/
public init(stockForiPhone iPhone: Int, iPad: Int, mac: Int, tv: Int)
{
self.createdAt = Date()
self.iPhoneStock = iPhone
self.iPadStock = iPad
self.macStock = mac
self.tvStock = tv
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment