Files
2018-06-13 12:13:50 +02:00

21 lines
469 B
Swift

import Foundation
/// Helper class to hold cached instance and expiry date.
/// Used in memory storage to work with NSCache.
class MemoryCapsule: NSObject {
/// Object to be cached
let object: Any
/// Expiration date
let expiry: Expiry
/**
Creates a new instance of Capsule.
- Parameter value: Object to be cached
- Parameter expiry: Expiration date
*/
init(value: Any, expiry: Expiry) {
self.object = value
self.expiry = expiry
}
}