lib/petrarca.rb in petrarca-0.4.14 vs lib/petrarca.rb in petrarca-0.5.0

- old
+ new

@@ -13,32 +13,32 @@ REGISTRANT_RANGES = Helpers.load_ranges("#{data_dir}/registrant_ranges.txt") extend self def valid?(isbn) - case isbn.delete("-").size + case isbn.to_s.delete("-").size when 13 ISBN13.valid?(isbn) when 10 ISBN10.valid?(isbn) else false end end def correct_format?(isbn) - case isbn.delete("-").size + case isbn.to_s.delete("-").size when 13 ISBN13.correct_format?(isbn) when 10 ISBN10.correct_format?(isbn) else false end end def calc_check_digit(isbn) - isbn = isbn.delete("-") + isbn = isbn.to_s.delete("-") case isbn.size when 12, 13 ISBN13.calc_check_digit(isbn) when 9, 10 ISBN10.calc_check_digit(isbn)