Module: OneApiSdk::Client::Books
- Included in:
- OneApiSdk::Client
- Defined in:
- lib/one_api_sdk/books.rb
Instance Method Summary collapse
-
#book(id, query_params = "") ⇒ Hash
Request one specific book.
-
#book_chapters(id, query_params = "") ⇒ Hash
Request one specific book.
-
#books(query_params = "") ⇒ Array<Hash>
List of all “The Lord of the Rings” books.
Instance Method Details
#book(id, query_params = "") ⇒ Hash
Request one specific book
23 24 25 26 |
# File 'lib/one_api_sdk/books.rb', line 23 def book(id,query_params="") response = call_with_token("#{Constants::BOOK_BASE_PATH}/#{id}#{query_params}") JSON.parse(response.body) end |
#book_chapters(id, query_params = "") ⇒ Hash
Request one specific book
33 34 35 36 |
# File 'lib/one_api_sdk/books.rb', line 33 def book_chapters(id,query_params="") response = call_with_token("#{Constants::BOOK_BASE_PATH}/#{id}/chapter#{query_params}") JSON.parse(response.body) end |
#books(query_params = "") ⇒ Array<Hash>
List of all “The Lord of the Rings” books
13 14 15 16 |
# File 'lib/one_api_sdk/books.rb', line 13 def books(query_params="") response = call_with_token("#{Constants::BOOK_BASE_PATH}#{query_params}") JSON.parse(response.body) end |