Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refacted card validation + txt field delegate #9

Merged
merged 1 commit into from
Mar 24, 2016
Merged

Conversation

Haud
Copy link
Contributor

@Haud Haud commented Mar 23, 2016

This resolves issues #7 and #8 proposed by @MichaelCampbell.

For #7

  • The delegate is now called on every single input along with a card and validation object; the delegate no longer accepts nil inputs for those parameters. Because of this, the card object passed in the delegate function is not guaranteed to be valid; the validation parameter will dictate if the card is valid or not and which parts are not valid. It is up to the receiver to check the input.
  • Refactored validation and moved it all to CardType extensions as the existing validation classes were too interdependent and, in some cases, redundant

For #8:

  • New method: toString() on CardValidationResult that returns an array of all strings.
  • description now maps the results of toString() to a multi line string with no { }; any other formats should now use toString with their own mapping.

Please look through and make sure these changes are the desired functionality.

@DannyVancura

@DannyVancura
Copy link
Contributor

Looks great! Couldn't find anything wrong with that implementation.

@MichaelCampbell
Copy link

👍 works well for me too. Thanks for simplifying the month and year extraction too

@Haud Haud merged commit f5895ca into master Mar 24, 2016
@Haud Haud deleted the refactor_delegate branch March 24, 2016 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants