Ruby: Validate a Credit Card Number
Download the Credit Card Library from Lucas Carlson.
user$ sudo gem install creditcard
# Checksum Digit, there is an algorithm that checksum must match # A. Import the libraries require 'rubygems' require 'creditcard' # B. Boolean test as to whether this number is a valid credit card puts '5276 4400 6542 1319'.creditcard? # C. Check the type of credit card it is puts '5276 4400 6542 1319'.creditcard_type