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.
Files changed (2) hide show
  1. data/lib/isbn.rb +9 -1
  2. 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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: entangledstate-isbn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Kersey