Author: David Herse Last Edited: 16/01/2013 Requires: Ruby 1.9.3
Takes credit card numbers – checks type and validity – returns array of strings in format "#{type}: #{number} (#{valid})"
$ ruby tc_cn_check.rb
$ ruby cn_check.rb 4408 0412 3456 7893
$ ruby cn_check.rb "
> 4111111111111111
> 4012888888881881
> 6011111111111117
> "
validate_cards("4111111111111111")
validate_cards("
4111111111111111
4111111111111
4012888888881881
")