Made Validation protocol extension properties public
This commit is contained in:
parent
ce7a9362ed
commit
dc5a6f872a
|
@ -21,10 +21,10 @@ public protocol LengthValidation: Validation where Supported: Collection {
|
|||
}
|
||||
|
||||
extension LengthValidation {
|
||||
static var minLength: Int { return 0 }
|
||||
public static var minLength: Int { return 0 }
|
||||
|
||||
/// See `Validation.validate(_:)`.
|
||||
static func validate(_ value: Supported)throws {
|
||||
public static func validate(_ value: Supported)throws {
|
||||
guard value.count <= self.maxLength else {
|
||||
throw ValidationError(identifier: "lengthTooLong", reason: "Length of collection value is greater than \(self.maxLength)")
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ public protocol InRangeValidation: Validation where Supported: Comparable {
|
|||
}
|
||||
|
||||
extension InRangeValidation {
|
||||
static var max: Supported? { return nil }
|
||||
static var min: Supported? { return nil }
|
||||
public static var max: Supported? { return nil }
|
||||
public static var min: Supported? { return nil }
|
||||
|
||||
/// See `Validation.validate(_:)`.
|
||||
public static func validate(_ value: Supported)throws {
|
||||
|
|
Loading…
Reference in New Issue