entangledstate-isbn 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/isbn.rb +9 -1
- metadata +1 -1
data/lib/isbn.rb
CHANGED
@@ -41,7 +41,15 @@ module ISBN
|
|
41
41
|
when '978' then calculate(isbn.sub(/^978/, "290"))
|
42
42
|
when '290' then calculate(isbn.sub(/^290/, "978"))
|
43
43
|
end
|
44
|
-
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def thirteen(isbn)
|
47
|
+
case isbn.size
|
48
|
+
when 13 then isbn
|
49
|
+
when 10 then from_10_to_13(isbn)
|
50
|
+
else raise InvalidISBNError
|
51
|
+
end
|
52
|
+
end
|
45
53
|
|
46
54
|
def valid?(isbn)
|
47
55
|
begin
|