entangledstate-isbn 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|