From b98ba90eb585df84cffb1541ba3e1d24cc89fdc9 Mon Sep 17 00:00:00 2001 From: James Nocentini Date: Wed, 18 Apr 2018 18:14:20 +0100 Subject: [PATCH] [docs] .and() clause (#2143) * [docs] `.and() clause` * [docs] update per review. --- Swift/Expression.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Swift/Expression.swift b/Swift/Expression.swift index 9a67e59e0..857f702de 100644 --- a/Swift/Expression.swift +++ b/Swift/Expression.swift @@ -313,6 +313,10 @@ public final class Expression { /// Creates a negated expression representing the negated result of the given expression. /// + /// If the operand isn't a boolean type, it gets coerced to a boolean. The number 0 is coerced to false, + /// the number 1 is coerced to `true`, strings are coerced to `false` (but strings prefixed with a number + /// are coerced to `true`, for example "2willowroad@nationaltrust.org.uk"). + /// /// - Parameter expression: The expression to be negated. /// - Returns: A negated expression public static func not(_ expression: ExpressionProtocol) -> ExpressionProtocol { @@ -486,6 +490,10 @@ public final class Expression { /// Creates a logical AND expression that performs logical AND operation with the current /// expression. /// + /// If the operand isn't a boolean type, it gets coerced to a boolean. The number 0 is coerced to false, + /// the number 1 is coerced to `true`, strings are coerced to `false` (but strings prefixed with a number + /// are coerced to `true`, for example "2willowroad@nationaltrust.org.uk"). + /// /// - Parameter expression: The expression to AND with the current expression. /// - Returns: A logical AND expression. public func and(_ expression: ExpressionProtocol) -> ExpressionProtocol { @@ -495,6 +503,10 @@ public final class Expression { /// Creates a logical OR expression that performs logical OR operation with the current /// expression. /// + /// If the operand isn't a boolean type, it gets coerced to a boolean. The number 0 is coerced to false, + /// the number 1 is coerced to `true`, strings are coerced to `false` (but strings prefixed with a number + /// are coerced to `true`, for example "2willowroad@nationaltrust.org.uk"). + /// /// - Parameter expression: The expression to OR with the current expression. /// - Returns: A logical OR Expression. public func or(_ expression: ExpressionProtocol) -> ExpressionProtocol {