/credit_check_recheck

Object oriented credit card validity checker

Primary LanguageRuby

README

Object oriented solution to this coding challenge.

Run tests: ruby test/credit_card_test.rb

Examples:

credit_card = CreditCard.new('4929735477250543')
credit_card.valid? # => true

credit_card = CreditCard.new('5541801923795240')
credit_card.valid? # => false

# works with American Express
amex_card = CreditCard.new('342804633855673')
amex_card.valid? # => true