File tree 2 files changed +4
-13
lines changed 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change 2
2
// CardExpiryRule.swift
3
3
// SwiftValidator
4
4
//
5
- // Created by Sprinthub on 13/03/2019.
5
+ // Created by Mark Boleigha on 13/03/2019.
6
6
// Copyright © 2019 jpotts18. All rights reserved.
7
7
//
8
8
@@ -17,10 +17,10 @@ public class CardExpiryRule: Rule {
17
17
/// Error message to be displayed if validation fails.
18
18
private var message : String
19
19
/**
20
- Initializes `CardNumberRule ` object with error message. Used to validate a card's expiry month .
20
+ Initializes `CardExpiryRule ` object with error message. Used to validate a card's expiry year .
21
21
22
22
- parameter message: String of error message.
23
- - returns: An initialized `CardNumberRule ` object, or nil if an object could not be created for some reason that would not result in an exception.
23
+ - returns: An initialized `CardExpiryRule ` object, or nil if an object could not be created for some reason that would not result in an exception.
24
24
*/
25
25
public init ( message : String = " Card expiry date is invalid " ) {
26
26
self . message = message
@@ -29,7 +29,7 @@ public class CardExpiryRule: Rule {
29
29
/**
30
30
Validates a field.
31
31
32
- - parameter value: String to check for validation.
32
+ - parameter value: String to check for validation. must be a card expiry date in MM/YY format
33
33
- returns: Boolean value. True on successful validation, otherwise False on failed Validation.
34
34
*/
35
35
public func validate( _ value: String ) -> Bool {
Original file line number Diff line number Diff line change @@ -34,15 +34,6 @@ public class CardNumberRule: Rule {
34
34
guard CardState ( fromNumber: cardNoFull) != . invalid else {
35
35
return false
36
36
}
37
- // let cardState = CardState(fromNumber: cardNoFull)
38
- // switch cardState {
39
- // case .identified(let cardType):
40
- // print(cardType)
41
- // case .indeterminate:
42
- // print("undefined")
43
- // case .invalid:
44
- // print("invalid")
45
- // }
46
37
47
38
return true
48
39
You can’t perform that action at this time.
0 commit comments