ragalie/lisbn

isbn10_parts method - nice to have

Closed this issue · 2 comments

Currently "parts" method is splitting ISBN in ISBN13 format.
I need all ISBN display variations - also hyphenated ISBN10 .

Example output:
isbn = "832100928X"
lisbn = Lisbn.new(isbn)
lisbn.parts.join('-') => 978-83-210-0928-5

lsbn.isbn10_parts.join('-') => 83-210-0928-X

Would you be willing to open a PR for this functionality? One suggestion I'd make is that isbn10_parts is a bit of an unwieldy name. Maybe something like parts(number:) is a better signature, where it takes either 4 (for ISBN-10) or 5 (for ISBN-13)?

Yes I need it badly, good point with method naming.