Module: Readmill::Client::Books

Included in:
Readmill::Client
Defined in:
lib/readmill/client/books.rb

Overview

Public: This module will bring all of the methods from the book section of the API.

Instance Method Summary collapse

Instance Method Details

#book(id, opts = {}) ⇒ Object

Public: Get a specific book from readmill.

id - The id of a book to get from readmill. opts - A Hash of options used to modify the results. All of the values

of this Hash will be forwarded to the API as parameters
(default: {}).

Returns a Hashie::Mash.



27
28
29
# File 'lib/readmill/client/books.rb', line 27

def book(id, opts={})
  get("books/#{id}", opts)
end

#books(opts = {}) ⇒ Object

Public: Get all books from readmill.

opts - A Hash of options used to modify the results. All of the values

of this Hash will be forwarded to the API as parameters
(default: {}).

Returns an Array.



15
16
17
# File 'lib/readmill/client/books.rb', line 15

def books(opts={})
  get('books', opts).items
end