Class: BookFinder::Client
- Inherits:
-
Object
- Object
- BookFinder::Client
- Includes:
- HTTParty
- Defined in:
- lib/bookfinder/client.rb
Constant Summary collapse
- BASE_URI =
"https://www.googleapis.com/books/v1/"
Instance Method Summary collapse
- #books(name) ⇒ Object
-
#initialize ⇒ Client
constructor
this will only make requests to the public variation of the google books api.
Constructor Details
#initialize ⇒ Client
this will only make requests to the public variation of the google books api
9 10 |
# File 'lib/bookfinder/client.rb', line 9 def initialize end |
Instance Method Details
#books(name) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/bookfinder/client.rb', line 12 def books(name) response = http_get( endpoint: "volumes?q=", query: name.sub(" ","") ) response.map { |book| BookFinder::Book.new(book["volumeInfo"]) } end |