Created
June 9, 2018 03:10
-
-
Save vhart/5622d3190c460fee7cdba0c16f65cf33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum FilterValue { | |
case string(String) | |
case bool(Bool) | |
func matches(value: Any) -> Bool { | |
switch self { | |
case .string(let stringValue): | |
return (value as? String) == stringValue | |
case .bool(let boolValue): | |
return (value as? Bool) == boolValue | |
} | |
} | |
} | |
enum FilterQuery { | |
case none | |
case filters([String: FilterValue]) //[Key: FilterValue] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment