From 6713bbf2784c2f99440ad4fc1944b0978db3d7bc Mon Sep 17 00:00:00 2001 From: KOTARO SUTO Date: Sun, 17 Mar 2024 15:52:29 -0700 Subject: [PATCH] Renames `number` --- Sources/Scripting/Script+Comparable.swift | 42 +++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Sources/Scripting/Script+Comparable.swift b/Sources/Scripting/Script+Comparable.swift index 0a05a64..97a135b 100644 --- a/Sources/Scripting/Script+Comparable.swift +++ b/Sources/Scripting/Script+Comparable.swift @@ -1,37 +1,37 @@ /// Scripting methods whose values are comparable extension Script where T: Comparable { - /// This method return true when the piped value is more than `number` and false otherwise. - /// - Parameter number: `Comparable` value - /// - Returns: Bool value by comparing the piped value and the parameter `number` - public func more(than number: T) -> Script { - switch input { - case .success(let input): - return .init(success: input > number) + /// This method return true when the piped value is more than `rhs` and false otherwise. + /// - Parameter rhs: `Comparable` value + /// - Returns: Bool value by comparing the piped value and the parameter `rhs` + public func more(than rhs: T) -> Script { + switch lhs { + case .success(let lhs): + return .init(success: lhs > rhs) case .failure(let error): return .init(failure: error) } } - /// This method return true when the piped value is less than `number` and false otherwise. - /// - Parameter number: `Comparable` value - /// - Returns: Bool value by comparing the piped value and the parameter `number` - public func less(than number: T) -> Script { - switch input { - case .success(let input): - return .init(success: input < number) + /// This method return true when the piped value is less than `rhs` and false otherwise. + /// - Parameter rhs: `Comparable` value + /// - Returns: Bool value by comparing the piped value and the parameter `rhs` + public func less(than rhs: T) -> Script { + switch lhs { + case .success(let lhs): + return .init(success: lhs < rhs) case .failure(let error): return .init(failure: error) } } - /// This method return true when the piped value is equal to `number` and false otherwise. - /// - Parameter number: `Comparable` value - /// - Returns: Bool value by comparing the piped value and the parameter `number` - public func equal(to number: T) -> Script { - switch input { - case .success(let input): - return .init(success: input == number) + /// This method return true when the piped value is equal to `rhs` and false otherwise. + /// - Parameter rhs: `Comparable` value + /// - Returns: Bool value by comparing the piped value and the parameter `rhs` + public func equal(to rhs: T) -> Script { + switch lhs { + case .success(let lhs): + return .init(success: lhs == rhs) case .failure(let error): return .init(failure: error) }