Sha256: 6b4db0b10863539ed13aa2b4a7cb53febaf32cb2e109c121b58d8f1929e04e56

Contents?: true

Size: 880 Bytes

Versions: 1

Compression:

Stored size: 880 Bytes

Contents

Bookland
========

Bookland provides a simple ISBN class in Ruby.

![ISBN](http://upload.wikimedia.org/wikipedia/commons/thumb/2/28/EAN-13-ISBN-13.svg/540px-EAN-13-ISBN-13.svg.png)

Examples
--------

    include Bookland
    
    book = ISBN.new("0262011530")
    book.to_isbn13
    => "9780262011532"
    
    book.to_s(1, 3, 5)
    => "0-262-01153-0"
    
    book == ISBN.new("9780262011532")
    => true
    
    # An invalid ISBN
    book = ISBN.new("0262011531")
    book.valid?
    => false
    
    book.to_isbn13
    => Bookland::ISBNError: ISBN not valid

Or use some class methods:

    include Bookland
    ISBN.to_13("0262011530")
    => "9780262011532"
    
    ISBN.to_10("9780262011532")
    => "0262011530"

    ISBN.valid?("9780262011532")
    => true

Compatibility
-------------

Specs pass against all usual suspects, including Ruby 1.8.7, 1.9.1, and 1.9.2.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bookland-0.3.1 README.md