Sha256: 0a9a9622a4aff8ef9f2936c9ab5115fd06178fc25deae1e0aa26a2a3ca2f72c9

Contents?: true

Size: 579 Bytes

Versions: 4

Compression:

Stored size: 579 Bytes

Contents

module GoogleBook
  class Book < Struct.new :images,
                          :info,
                          :preview,
                          :creator,
                          :date,
                          :description,
                          :format,
                          :identifier,
                          :publisher,
                          :subject,
                          :title

    def isbn
      @isbn ||= find_isbn
    end

    private

    def find_isbn
      identifier.detect { |i| i.match(/ISBN:([0-9]{13})/) }
      $1
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
googlebook-0.1.5 lib/googlebook/book.rb
googlebook-0.1.4 lib/googlebook/book.rb
googlebook-0.1.3 lib/googlebook/book.rb
googlebook-0.1.2 lib/googlebook/book.rb