Module: ComicVine::Api::HTTPService
- Defined in:
- lib/comic_vine/api/http_service.rb
Constant Summary collapse
- DEFAULT_MIDDLEWARE =
proc do |builder| builder.adapter Faraday.default_adapter end
Class Attribute Summary collapse
-
.faraday_middleware ⇒ Object
Returns the value of attribute faraday_middleware.
-
.http_options ⇒ Object
Returns the value of attribute http_options.
Class Method Summary collapse
Class Attribute Details
.faraday_middleware ⇒ Object
Returns the value of attribute faraday_middleware.
7 8 9 |
# File 'lib/comic_vine/api/http_service.rb', line 7 def faraday_middleware @faraday_middleware end |
.http_options ⇒ Object
Returns the value of attribute http_options.
7 8 9 |
# File 'lib/comic_vine/api/http_service.rb', line 7 def @http_options end |
Class Method Details
.make_request(request) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/comic_vine/api/http_service.rb', line 26 def self.make_request(request) connection = Faraday.new( request.server, (request.), &(faraday_middleware || DEFAULT_MIDDLEWARE) ) response = connection.send(request.verb, request.path, request.args) ComicVine::Api::Response.new( status: response.status.to_i, headers: response.headers, body: response.body ) end |