Class: Faker::Code

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/code.rb

Constant Summary

Constants inherited from Base

Base::Letters, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, fetch, flexible, letterify, method_missing, numerify, parse, regexify, translate

Class Method Details

.isbn(base = 10) ⇒ Object

By default generates 10 sign isbn code in format 123456789-X You can pass 13 to generate new 13 sign code



6
7
8
# File 'lib/faker/code.rb', line 6

def isbn(base = 10)
  base == 13 ? generate_base13_isbn : generate_base10_isbn
end