Class: Book

Inherits:
Structure
  • Object
show all
Defined in:
lib/book.rb,
lib/book/version.rb

Constant Summary collapse

VERSION =
'0.1.0'

Instance Method Summary collapse

Instance Method Details

#isbnObject



15
16
17
18
19
20
21
# File 'lib/book.rb', line 15

def isbn
  identifier =
    identifiers.detect { |identifier| identifier.name == 'ISBN-13' } ||
    identifiers.detect { |identifier| identifier.name == 'ISBN-10' }

  identifier ? identifier.value : nil
end