Project

isbnify

0.0
No commit activity in last 3 years
No release in over 3 years
This gem verifies, creates and hyphinates ISBN13 numbers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.2.3
~> 1.3.0
>= 0
~> 2.14.1
~> 0.7.1
~> 2.6.0

Runtime

 Project Readme

isbnify

isbnify API Documentation

hyphenate, verify and create ISBN13 numbers

Functionality

  • creates valid ISBN13 fake numbers, allready hyphinated
  • check ISBN13 validity of a given number
  • hyphinate valid ISBN13 number

Implementation

Include Isbnify into your controller and use the helper actions or call object Isbnify::ISBN class actions.

Functions

create_isbn or Isbnify::ISBN.create_isbn

Returns a random, yet valid fake ISBN allready hyphinated.

hyphinate_isbn(String) or Isbnify::ISBN.hyphinate_isbn(String)

Returns hyphinated ISBN or error message as String.

valid_isbn?(String) or Isbnify::ISBN.valid_isbn?(String)

Returns true or false, whether a given ISBN is valid or not. It can be passed as hyphinated ISBN or not.

Useable method calls

class ApplicationController < ActionController
  include Isbnify

  def some_method
    hyphinate_isbn("9783404166695")               # returns "978-3-404-16669-5"
    Isbnify::ISBN.hyphinate_isbn("9783404166695") # returns "978-3-404-16669-5"
  end

  def some_other_method
    valid_isbn?("9783404166695")                  # returns true
    Isbnify::ISBN.valid_isbn?("9783404166695")    # returns true
  end

  def some_last_method
    create_isbn                       # returns random well-formed isbn number
    Isbnify::ISBN.create_isbn         # returns random well-formed isbn number
  end

end

Ruby Versions

This gem was developed and tested with versions 1.9.3 and 2.0.0

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright

Copyright (c) 2013 - 2015 Christoph Seydel. See LICENSE for further details.