Module: Goodreads::Books
- Included in:
- Client
- Defined in:
- lib/goodreads/client/books.rb
Instance Method Summary collapse
-
#book(id) ⇒ Object
Get book details by Goodreads book ID.
-
#book_by_isbn(isbn) ⇒ Object
Get book details by book ISBN.
-
#book_by_title(title) ⇒ Object
Get book details by book title.
-
#search_books(query, params = {}) ⇒ Object
Search for books.
Instance Method Details
#book(id) ⇒ Object
Get book details by Goodreads book ID
19 20 21 |
# 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) ⇒ Object
Get book details by book ISBN
25 26 27 |
# 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) ⇒ Object
Get book details by book title
31 32 33 |
# 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 = {}) ⇒ Object
11 12 13 14 15 |
# 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 |