module Goodreads::Books
Public Instance Methods
book(id)
click to toggle source
Get book details by Goodreads
book ID
# File lib/goodreads/client/books.rb, line 19 def book(id) Hashie::Mash.new(request("/book/show", id: id)["book"]) end
book_by_isbn(isbn)
click to toggle source
Get book details by book ISBN
# File lib/goodreads/client/books.rb, line 25 def book_by_isbn(isbn) Hashie::Mash.new(request("/book/isbn", isbn: isbn)["book"]) end
book_by_title(title)
click to toggle source
Get book details by book title
# File lib/goodreads/client/books.rb, line 31 def book_by_title(title) Hashie::Mash.new(request("/book/title", title: title)["book"]) end
search_books(query, params = {})
click to toggle source
Search for books
query - Text to match against book title, author, and ISBN fields. options - Optional search parameters
options - Which page to returns (default: 1) options - Search field. One of: title, author, or genre (default is all)
# File lib/goodreads/client/books.rb, line 11 def search_books(query, params = {}) params[:q] = query.to_s.strip data = request("/search/index", params) Hashie::Mash.new(data["search"]) end