Class: Gtiny::ISBN10
Overview
ISBN-10: Used for books published before 2007.
Class Method Summary collapse
-
.regex ⇒ Object
The ISBN-10 format consists of 4 groups, separated by hyphens (or spaces).
Instance Method Summary collapse
Methods inherited from ISBN
#check_digit, #group_identifier, normalize, #publisher_identifier, #title_identifier, #valid?
Methods inherited from Encoding
#initialize, matches?, normalize, #to_s, #valid?, #zeroes?
Constructor Details
This class inherits a constructor from Gtiny::Encoding
Class Method Details
.regex ⇒ Object
The ISBN-10 format consists of 4 groups, separated by hyphens (or spaces).
-
The group identifier, up to five digits
-
The publisher identifier, up to seven digits
-
The title identifier, up to 6 digits
-
The check digit
14 15 16 |
# File 'lib/gtiny/isbn10.rb', line 14 def self.regex /\A[0-9]{1,5}[- ]?[0-9]{1,7}[- ]?[0-9]{1,6}[- ]?[0-9xX]\z/ end |
Instance Method Details
#type ⇒ Object
18 19 20 |
# File 'lib/gtiny/isbn10.rb', line 18 def type "ISBN-10" end |