Skip to content

Commit

Permalink
add notEquals operator (adobe#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyansong-adbe authored Aug 24, 2020
1 parent df4dd8d commit 9718c3e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/SwiftRulesEngine/ConditionEvaluator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ public extension ConditionEvaluator {
addComparisonOperator(operation: "equals", type: Int.self, closure: ==)
addComparisonOperator(operation: "equals", type: Double.self, closure: ==)
addComparisonOperator(operation: "equals", type: Bool.self, closure: ==)

addComparisonOperator(operation: "notEquals", type: String.self, closure: !=)
addComparisonOperator(operation: "notEquals", type: Int.self, closure: !=)
addComparisonOperator(operation: "notEquals", type: Double.self, closure: !=)
addComparisonOperator(operation: "notEquals", type: Bool.self, closure: !=)

addComparisonOperator(operation: "startsWith", type: String.self, closure: { $0.starts(with: $1) })
addComparisonOperator(operation: "endsWith", type: String.self, closure: { $0.hasSuffix($1) })
Expand Down

0 comments on commit 9718c3e

Please sign in to comment.