Module: GoogleImages::NetworkRequester
- Defined in:
- lib/google_images/network_requester.rb
Overview
This class acts as a facade between http client library ‘http.rb` and our source code for abstracting library’s entities and exceptions and using only needed part of the http client library API
Class Method Summary collapse
-
.get(url) ⇒ Object
Performs json GET request.
Class Method Details
.get(url) ⇒ Object
Performs json GET request
17 18 19 20 21 |
# File 'lib/google_images/network_requester.rb', line 17 def self.get(url) HTTP.headers(accept: 'application/json').get(url) rescue => e raise GoogleImages::Errors::NetworkError, 'Network Error' end |