isbn-converter.rb

Path: lib/isbn-converter.rb
Last Update: Tue Mar 14 08:20:30 Eastern Standard Time 2006

Convert ISBN as 10-digit string to 13-digit string Can handle dashes, returns nil if the ISBN is not 10 digits Also returns the ISBN if ISBN is 13 digits and begins with 978 or 979 Por ejemplo: to13("0940016737")

Methods

clean   to10   to13  

Public Instance methods

This helper method just cleans up ISBNs

Convert ISBN as 13-digit string to 10-digit string Can handle dashes, returns nil if the ISBN is not 13 digits Por ejemplo: to10("978-0-940016-73-6")

Convert ISBN as 10-digit string to 13-digit string Can handle dashes, returns nil if the ISBN is not 10 digits Also returns the ISBN if ISBN is 13 digits and begins with 978 or 979 Por ejemplo: to13("0940016737")

[Validate]