Files
hyperoslo-Cache/Source/Shared/DataStructures/StorageKind.swift
T
2016-04-27 02:10:37 +02:00

28 lines
488 B
Swift

/**
Helper enum to specify a kind of the storage
*/
public enum StorageKind {
/// Memory storage
case Memory
/// Disk storage
case Disk
/// Custom kind of storage by the given name
case Custom(String)
/// Converts value to appropriate string
public var name: String {
let result: String
switch self {
case .Memory:
result = "Memory"
case .Disk:
result = "Disk"
case .Custom(let name):
result = name
}
return result
}
}